]> git.kaiwu.me - njs.git/commit
Fixed Array.prototype.concat() when array is changed while iterating.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 13 Jan 2022 16:20:58 +0000 (16:20 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 13 Jan 2022 16:20:58 +0000 (16:20 +0000)
commit232fb594608cac2094131af4322f2062cefbaeb2
tree8151f0b7c2c9700be5e7599087df74730d995517
parent377745d4c56bffba9a62c4f85465389b71115df8
Fixed Array.prototype.concat() when array is changed while iterating.

Previously, the flat array may be converted to a slow one as a
side-effect of a custom getter invocation for a proto array object.
The function erroneously assumed that the this array remains flat
while iterating.

The fix is to eliminate the micro-optimization which uses direct
pointers.

The problem is similar to the previous commits.
src/njs_array.c
src/test/njs_unit_test.c