aboutsummaryrefslogtreecommitdiff
path: root/dynasm
diff options
context:
space:
mode:
authorMike Pall <mike>2023-12-23 20:06:17 +0100
committerMike Pall <mike>2023-12-23 20:06:17 +0100
commitc525bcb9024510cad9e170e12b6209aedb330f83 (patch)
tree38f2e2d72bcd2ad72ee230ac3debc4f8d4ed8865 /dynasm
parentdbd363ca256bbc671834253e7cbe226b397af8c8 (diff)
downloadluajit-c525bcb9024510cad9e170e12b6209aedb330f83.tar.gz
luajit-c525bcb9024510cad9e170e12b6209aedb330f83.tar.bz2
luajit-c525bcb9024510cad9e170e12b6209aedb330f83.zip
DynASM/x86: Allow [&expr] operand.
Thanks to Dmitry Stogov. #1138
Diffstat (limited to 'dynasm')
-rw-r--r--dynasm/dasm_x86.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/dynasm/dasm_x86.lua b/dynasm/dasm_x86.lua
index 787163c0..df70fed8 100644
--- a/dynasm/dasm_x86.lua
+++ b/dynasm/dasm_x86.lua
@@ -627,7 +627,11 @@ local function wputmrmsib(t, imark, s, vsreg, psz, sk)
627 werror("NYI: rip-relative displacement followed by immediate") 627 werror("NYI: rip-relative displacement followed by immediate")
628 end 628 end
629 -- The previous byte in the action buffer cannot be 0xe9 or 0x80-0x8f. 629 -- The previous byte in the action buffer cannot be 0xe9 or 0x80-0x8f.
630 wputlabel("REL_", disp[1], 2) 630 if disp[2] == "iPJ" then
631 waction("REL_A", disp[1])
632 else
633 wputlabel("REL_", disp[1], 2)
634 end
631 else 635 else
632 wputdarg(disp) 636 wputdarg(disp)
633 end 637 end
@@ -744,9 +748,9 @@ local function dispexpr(expr)
744 return imm*map_opsizenum[ops] 748 return imm*map_opsizenum[ops]
745 end 749 end
746 local mode, iexpr = immexpr(dispt) 750 local mode, iexpr = immexpr(dispt)
747 if mode == "iJ" then 751 if mode == "iJ" or mode == "iPJ" then
748 if c == "-" then werror("cannot invert label reference") end 752 if c == "-" then werror("cannot invert label reference") end
749 return { iexpr } 753 return { iexpr, mode }
750 end 754 end
751 return expr -- Need to return original signed expression. 755 return expr -- Need to return original signed expression.
752end 756end