]> git.kaiwu.me - njs.git/commit
Fixed attaching of a stack to an error object.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 28 Feb 2023 08:26:45 +0000 (00:26 -0800)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 28 Feb 2023 08:26:45 +0000 (00:26 -0800)
commit96ec9d20b159329f72904ed39cfa6402652ae564
tree81137fc4412f72a3f05627d86fd6efd5f1737d84
parent4907379ca3bfcfd524e816f47a21ac87410ab707
Fixed attaching of a stack to an error object.

This problem is similar to previous commits.  When
njs_error_stack_attach() accepted the value as a pointer to vm->retval
that value might be changed as a side effert of njs_error_stack_new()
evaluation.  This may result in a garbage value for
njs_object(value) expression.

The workaround fix is to make a copy of vm->retval to ensure its
intergrity and to preserve it as a retval. The proper fix is to
eliminate vm->retval altogether.

This fixes #612, #613, #616 issues on Github.
src/njs_vmcode.c
src/test/njs_unit_test.c