1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-11-14 09:39:03 -08:00

fix align/skip fill value overflow

This commit is contained in:
Connor Olding 2016-04-20 02:35:57 -07:00
parent d10c0f0ee9
commit a655e67bd3
2 changed files with 2 additions and 3 deletions

View file

@ -127,13 +127,13 @@ function Dumper:add_directive(fn, line, name, a, b)
end
local temp = self.pos + align - 1
t.skip = temp - (temp % align) - self.pos
t.fill = t.fill or 0
t.fill = b and b % 0x100 or 0
insert(self.commands, t)
self:advance(t.skip)
elseif name == 'SKIP' then
t.kind = 'ahead'
t.skip = a
t.fill = b
t.fill = b and b % 0x100 or nil
insert(self.commands, t)
self:advance(t.skip)
else

View file

@ -23,7 +23,6 @@ function Parser:directive()
local function add(...)
self.dumper:add_directive(self.fn, self.line, ...)
end
-- FIXME: some of these directives allow byte values greater than 255
if name == 'ORG' then
add(name, self:number().tok)
elseif name == 'ALIGN' or name == 'SKIP' then