1
0
Fork 0
mirror of https://github.com/notwa/lips synced 2024-11-14 17:59:02 -08:00

fix branching in some cases

This commit is contained in:
Connor Olding 2015-12-26 19:55:08 -08:00
parent a3bb50a1a6
commit 12ca82e40a

View file

@ -1474,7 +1474,9 @@ function Dumper:desym(tok)
if label == nil then
self:error('undefined label')
end
local rel = floor(label/4) - 1 - floor(self.pos/4)
label = label % 0x80000000
local pos = self.pos % 0x80000000
local rel = floor(label/4) - 1 - floor(pos/4)
if rel > 0x8000 or rel <= -0x8000 then
self:error('branch too far')
end