diff options
author | Mike Pall <mike> | 2011-04-03 20:49:51 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-04-03 20:49:51 +0200 |
commit | 2138df2662795b64065c62c66c867f2a06e780db (patch) | |
tree | 88f22b54214c729797ade9e83c114c76697c0237 | |
parent | 5b06b298a2ddd95b0512c483d78589a84faad4e6 (diff) | |
download | luajit-2138df2662795b64065c62c66c867f2a06e780db.tar.gz luajit-2138df2662795b64065c62c66c867f2a06e780db.tar.bz2 luajit-2138df2662795b64065c62c66c867f2a06e780db.zip |
ARM: Fix escaping of opcodes in DynASM.
-rw-r--r-- | dynasm/dasm_arm.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dynasm/dasm_arm.lua b/dynasm/dasm_arm.lua index 011757c1..780cb29c 100644 --- a/dynasm/dasm_arm.lua +++ b/dynasm/dasm_arm.lua | |||
@@ -25,7 +25,7 @@ local assert, setmetatable, rawget = assert, setmetatable, rawget | |||
25 | local _s = string | 25 | local _s = string |
26 | local sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char | 26 | local sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char |
27 | local match, gmatch, gsub = _s.match, _s.gmatch, _s.gsub | 27 | local match, gmatch, gsub = _s.match, _s.gmatch, _s.gsub |
28 | local concat, sort = table.concat, table.sort | 28 | local concat, sort, insert = table.concat, table.sort, table.insert |
29 | 29 | ||
30 | -- Inherited tables and callbacks. | 30 | -- Inherited tables and callbacks. |
31 | local g_opt, g_arch | 31 | local g_opt, g_arch |
@@ -127,6 +127,10 @@ end | |||
127 | -- Store word to reserved position. | 127 | -- Store word to reserved position. |
128 | local function wputpos(pos, n) | 128 | local function wputpos(pos, n) |
129 | assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range") | 129 | assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, "word out of range") |
130 | if n <= 0x000fffff then | ||
131 | insert(actlist, pos+1, n) | ||
132 | n = map_action.ESC * 0x10000 | ||
133 | end | ||
130 | actlist[pos] = n | 134 | actlist[pos] = n |
131 | end | 135 | end |
132 | 136 | ||
@@ -688,7 +692,7 @@ map_op[".template__"] = function(params, template, nparams) | |||
688 | local n = 1 | 692 | local n = 1 |
689 | 693 | ||
690 | -- Limit number of section buffer positions used by a single dasm_put(). | 694 | -- Limit number of section buffer positions used by a single dasm_put(). |
691 | -- A single opcode needs a maximum of 3 positions (rlwinm). | 695 | -- A single opcode needs a maximum of 3 positions. |
692 | if secpos+3 > maxsecpos then wflush() end | 696 | if secpos+3 > maxsecpos then wflush() end |
693 | local pos = wpos() | 697 | local pos = wpos() |
694 | 698 | ||