diff options
| -rw-r--r-- | dynasm/dasm_x86.lua | 10 |
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. |
| 752 | end | 756 | end |
