Commit f27e6ca
x86/x64: Change ipairs_aux to match JIT backend behavior.
Thanks to Sergey Kaplun.
(cherry picked from commit 64b1f10)
In the single-number VM, `ipairs_aux()` first adds the 1 to the given
number and only after casts it to an integer. This leads to results
different from PUC Rio Lua 5.1 and inconsistent with JIT engine
recording.
This patch fixes it by casting the value to an integer before addition.
Sergey Kaplun:
* added the description and the test for the problem
Part of tarantool/tarantool#12480
Reviewed-by: Evgeniy Temirgaleev <e.temirgaleev@tarantool.org>
Reviewed-by: Sergey Bronnikov <sergeyb@tarantool.org>
Signed-off-by: Sergey Kaplun <skaplun@tarantool.org>1 parent 74d1f91 commit f27e6ca
3 files changed
Lines changed: 38 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1476 | 1476 | | |
1477 | 1477 | | |
1478 | 1478 | | |
1479 | | - | |
| 1479 | + | |
1480 | 1480 | | |
1481 | 1481 | | |
1482 | | - | |
1483 | 1482 | | |
| 1483 | + | |
1484 | 1484 | | |
1485 | 1485 | | |
1486 | 1486 | | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
| 1487 | + | |
1490 | 1488 | | |
1491 | 1489 | | |
1492 | 1490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1853 | 1853 | | |
1854 | 1854 | | |
1855 | 1855 | | |
1856 | | - | |
1857 | | - | |
1858 | | - | |
1859 | | - | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
1860 | 1859 | | |
1861 | 1860 | | |
1862 | 1861 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments