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

disallow 0 in place of r0/zero register

This commit is contained in:
Connor Olding 2016-01-05 16:45:53 -08:00
parent 361b0572f6
commit f630990c6e

View file

@ -899,12 +899,7 @@ end
function Parser:register(t)
t = t or registers
if self.tt ~= 'REG' then
if self.tt == 'NUM' and self.tok == '0' then
self.tt = 'REG'
self.tok = 'R0'
else
self:error('expected register')
end
self:error('expected register')
end
local reg = self.tok
if not t[reg] then