]> git.kaiwu.me - njs.git/commit
Fixed function constructor for cloned VMs.
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 29 Sep 2021 13:45:26 +0000 (13:45 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Wed, 29 Sep 2021 13:45:26 +0000 (13:45 +0000)
commitf59bdfefd446f7d56a535c29eec693c6c028beea
tree7a72df8a9e5fe183e7ddcec9b6b8b87cb3178d37
parent5279e0e800ef0812b108a75afb460e96f0fc0f98
Fixed function constructor for cloned VMs.

Previously a shared "keywords_hash" and "values_hash" were used while
compiling functions in runtime.  This led to populating a shared hash
with elements allocated in a cloned VM.  Which resulted in
heap-use-after-free when next cloned VM accesses the shared hashes.
src/njs_function.c
src/njs_generator.c
src/njs_lexer.c
src/njs_lexer.h
src/njs_module.c
src/njs_vm.c
src/njs_vm.h
src/test/njs_unit_test.c