]> git.kaiwu.me - njs.git/commit
Fixed backtraces while traversing imported user modules.
authorDmitry Volyntsev <xeioex@nginx.com>
Mon, 14 Feb 2022 14:10:04 +0000 (14:10 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Mon, 14 Feb 2022 14:10:04 +0000 (14:10 +0000)
commitbc1bbd158e956c888025893d8e585e7f79383f45
tree39298f9b2743a26b396d6303353500ff35ed517e
parent7bd570b39297d3d91902c93a624c89b08be7a6fe
Fixed backtraces while traversing imported user modules.

Previously, njs_builtin_match_native_function(), which is used to build a
backtrace for an exception, assumed that user modules always return
object values, which is not the case.  As a result, njs_object_traverse()
may receive incorrect pointer.

This fix is to only traverse object values.
src/njs_builtin.c
test/js/import_native_module_exception.t.js [new file with mode: 0644]