Case VVARGIND added to luaK_storevar

In a global initialization, the variable does not pass through
'check_readonly', and therefore a VVARGIND is not normalized to a
VINDEXED.
This commit is contained in:
Roberto Ierusalimschy
2025-10-30 10:39:55 -03:00
parent d4eff00234
commit 0149b781d4
2 changed files with 16 additions and 0 deletions

View File

@@ -184,6 +184,18 @@ do -- _ENV as vararg parameter
a = 10
end ]]
assert(string.find(msg, "const variable 'a'"))
local function aux (... | _ENV)
global a; a = 10
return a
end
assert(aux() == 10)
local function aux (... | _ENV)
global a = 10
return a
end
assert(aux() == 10)
end