]> git.kaiwu.me - njs.git/commit
Fixed index generation for global objects.
authorAlexander Borisov <alexander.borisov@nginx.com>
Tue, 30 Jun 2020 15:22:18 +0000 (18:22 +0300)
committerAlexander Borisov <alexander.borisov@nginx.com>
Tue, 30 Jun 2020 15:22:18 +0000 (18:22 +0300)
commit7a7484cc7f602cee2e612490bbc133a1cc6e96c4
tree0f996aa3d323315cc3c3b7ee91fe8444f144a413
parent32a70c899c1f136fbc3f97fcc050d59e0bd8c6a5
Fixed index generation for global objects.

In c75a8fc6d534 "GLOBAL GET" instruction was introduced to handle unresolved
references.  The issue was that the "GLOBAL GET" instruction erroneously
used the assignment variable index as a destination index.
The result was that a variable was assigned the retval of a "GLOBAL GET"
instruction.

The fix is to use a separate temporary index for "GLOBAL GET".

This closes #289 issue on GitHub.
src/njs_generator.c
src/test/njs_unit_test.c