mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 15:34:09 +00:00
Updated memory parsing
The values of base and index registers have been passed as 0, if only displacement is passed the displacement is assumed to be alphanumeric (since label might be used)
This commit is contained in:
parent
8b20a0eae2
commit
1fe2176241
@ -325,10 +325,15 @@ local function split_memop(arg)
|
|||||||
return d, 0, parse_reg(b)
|
return d, 0, parse_reg(b)
|
||||||
end
|
end
|
||||||
-- Assuming the two registers are passed as "(r1,r2)", and displacement(d) is not specified
|
-- Assuming the two registers are passed as "(r1,r2)", and displacement(d) is not specified
|
||||||
local x, b = string.match(arg,"%(%s*("..reg..")%s*,%s*("..reg..")%s*%)$")
|
local x, b = match(arg,"%(%s*("..reg..")%s*,%s*("..reg..")%s*%)$")
|
||||||
if b then
|
if b then
|
||||||
return 0, parse_reg(x), parse_reg(b)
|
return 0, parse_reg(x), parse_reg(b)
|
||||||
end
|
end
|
||||||
|
-- Assuming that only displacement is passed, as either digit or label "45 or label1"
|
||||||
|
local d = match(arg,"[%w_]+")
|
||||||
|
if d then
|
||||||
|
return d, 0, 0
|
||||||
|
end
|
||||||
local reg, tailr = match(arg, "^([%w_:]+)%s*(.*)$")
|
local reg, tailr = match(arg, "^([%w_:]+)%s*(.*)$")
|
||||||
if reg then
|
if reg then
|
||||||
local r, tp = parse_reg(reg)
|
local r, tp = parse_reg(reg)
|
||||||
|
Loading…
Reference in New Issue
Block a user