]> git.kaiwu.me - njs.git/commit
Fixed njs_vmcode_interpreter() when await fails.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 2 Jun 2022 23:32:38 +0000 (16:32 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 2 Jun 2022 23:32:38 +0000 (16:32 -0700)
commitd09868bc71f9a990445959329ad8c1b10d3898f5
tree0dabdfd057344e53f2e0b68f7fdf979448240d13
parent04f59f9defeeb618260e620bb11466741c0e41e5
Fixed njs_vmcode_interpreter() when await fails.

Previously, while interpreting a user function, njs_vmcode_interpreter()
might return prematurely when an error happens in await instruction.
This is not correct because the current frame has to be unwound (or
exception caught) first.

The fix is to exit through only 5 appropriate exit points to ensure
proper unwinding.

The patch correctly fixes issue reported in 07ef6c1f04f1 (0.7.3).

This closes #506 issue on Github.
src/njs_vmcode.c
test/js/async_exception_in_await.t.js [new file with mode: 0644]