From fdb4b351a69efa29f250a014b16b742dfc2faf1c Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 2 Apr 2016 08:05:07 -0700 Subject: [PATCH] fix labels in word directives --- lips/Dumper.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lips/Dumper.lua b/lips/Dumper.lua index e1e3c42..24e2494 100644 --- a/lips/Dumper.lua +++ b/lips/Dumper.lua @@ -85,7 +85,8 @@ function Dumper:add_directive(fn, line, name, a, b) self:add_bytes(line, b1, b0) elseif name == 'WORD' then if type(a) == 'string' then - local t = {line=line, kind='label', name=a} + t.kind = 'label' + t.name = a insert(self.commands, t) self:advance(4) else @@ -270,7 +271,7 @@ function Dumper:dump() self.pos = self.pos + t.skip end elseif t.kind == 'label' then - local val = self:desym{'LABELSYM', t.name} + local val = self:desym{tt='LABELSYM', tok=t.name} val = (val % 0x80000000) + 0x80000000 local b0 = bitrange(val, 0, 7) local b1 = bitrange(val, 8, 15)