From 206c650689c535d195c3b359c2ded65cd1b5663e Mon Sep 17 00:00:00 2001 From: niravthakkar Date: Thu, 5 Jan 2017 14:48:09 +0530 Subject: [PATCH] Updated the memory parsing The order matters here, so just moved displacement check to end --- dynasm/dasm_s390x.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dynasm/dasm_s390x.lua b/dynasm/dasm_s390x.lua index b3cda6ff..0c1263c5 100644 --- a/dynasm/dasm_s390x.lua +++ b/dynasm/dasm_s390x.lua @@ -329,11 +329,6 @@ local function split_memop(arg) if b then return 0, parse_reg(x), parse_reg(b) 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*(.*)$") if reg then local r, tp = parse_reg(reg) @@ -341,6 +336,11 @@ local function split_memop(arg) return format(tp.ctypefmt, tailr), 0, r 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 -- TODO: handle values without registers? -- TODO: handle registers without a displacement? -- done, above ,needs to be tested werror("bad memory operand: "..arg)