diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-10-30 10:39:55 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-10-30 10:39:55 -0300 |
| commit | 0149b781d438091ce086449101a916e9b4456b4e (patch) | |
| tree | c57e788c302ecf257614c9c19b48336e54522a2d /testes/vararg.lua | |
| parent | d4eff00234dc55dac4cb86b6187f5607c1254f9b (diff) | |
| download | lua-0149b781d438091ce086449101a916e9b4456b4e.tar.gz lua-0149b781d438091ce086449101a916e9b4456b4e.tar.bz2 lua-0149b781d438091ce086449101a916e9b4456b4e.zip | |
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.
Diffstat (limited to 'testes/vararg.lua')
| -rw-r--r-- | testes/vararg.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testes/vararg.lua b/testes/vararg.lua index 5711f78b..840c3eee 100644 --- a/testes/vararg.lua +++ b/testes/vararg.lua | |||
| @@ -184,6 +184,18 @@ do -- _ENV as vararg parameter | |||
| 184 | a = 10 | 184 | a = 10 |
| 185 | end ]] | 185 | end ]] |
| 186 | assert(string.find(msg, "const variable 'a'")) | 186 | assert(string.find(msg, "const variable 'a'")) |
| 187 | |||
| 188 | local function aux (... | _ENV) | ||
| 189 | global a; a = 10 | ||
| 190 | return a | ||
| 191 | end | ||
| 192 | assert(aux() == 10) | ||
| 193 | |||
| 194 | local function aux (... | _ENV) | ||
| 195 | global a = 10 | ||
| 196 | return a | ||
| 197 | end | ||
| 198 | assert(aux() == 10) | ||
| 187 | end | 199 | end |
| 188 | 200 | ||
| 189 | 201 | ||
