]> git.kaiwu.me - njs.git/commit
Fixed Array.prototype.reverse() when array is changed while iterating.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 14 Jan 2022 14:40:27 +0000 (14:40 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 14 Jan 2022 14:40:27 +0000 (14:40 +0000)
commit2901281ee5023567534a1c947123eea3650dbabe
treee0087deb1a0ed822fe93eb9625570ecf8830938e
parent3eadf4228a9f9dc4fc5f9bcc9c05d7f5a9084cf8
Fixed Array.prototype.reverse() 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