lua-users home
lua-l archive

Off-by-one when clearing stack slot after restart of a goto scope

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,
Not sure if this was reported.
This one was found via LuaJITs regression tests ported to Lua [1]:
do
 local k = 0
 local x
 ::foo::
 local y
 assert(not y)
 y = true
 k = k + 1
 if k < 2 then goto foo end
end
After removing the 'x' variable
do
 local k = 0
 ::foo::
 local y
 assert(not y)
 y = true
 k = k + 1
 if k < 2 then goto foo end
end
The test will pass. Hitting it on both 5.2 and 5.3.
[1] https://github.com/katlogic/lest

AltStyle によって変換されたページ (->オリジナル) /