PlutoLang / Pluto

A superset of Lua 5.4 with a focus on general-purpose programming.
https://pluto-lang.org/docs/Introduction
MIT License
339 stars 20 forks source link

Fix continue possibly closing too many upvalues #797

Closed Sainan closed 2 months ago

XmiliaH commented 2 months ago

Not the close is missing again

local t
repeat
    do
        local u1, u2, u3, u4
        t = ||->u4
        continue
    end
until true
do
    for k in pairs({}) do end
end
print(t())
XmiliaH commented 2 months ago

The new function should also be used for for-loops

local t
do
    for i = 1, 1 do
        do
            local u1
            t = ||->u1
            continue
        end
    end
end
do
    local x
    for k in pairs({}) do end
end
print(t())