Commit a62c8b0
committed
Fix GCobj pointer comparison in BC_ISEQV/BC_ISNEV
When comparing GC objects payload (i.e. their GCobj pointers) in scope
of BC_ISEQV/BC_ISNEV bytecodes, both values are loaded into the 64-bit
registers, but only lower 32 bits are compared later. Hence, there might
be the address parts clashing, leading to invalid comparison results,
when the LSBs are the same, but the MSBs are not.
This register mischoice was introduced in the very first uJIT commit,
since VM code had been taken intact from vanilla LuaJIT sources, but
128-bit TValue (and, ergo, 64-bit GCobj pointers) are uJIT specifics.
So, this is likely a typo, undetected since 2015.
As a result of the patch, 64-bit registers are used in this <cmp>
instruction. Unfortunately, I have no reproducer for this, so I can't
provide a proper test for this changeset.
Signed-off-by: Igor Munkin <imun@cpan.org>1 parent e0e89c8 commit a62c8b0
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2709 | 2709 | | |
2710 | 2710 | | |
2711 | 2711 | | |
2712 | | - | |
| 2712 | + | |
2713 | 2713 | | |
2714 | 2714 | | |
2715 | 2715 | | |
| |||
0 commit comments