aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-02-15 12:28:46 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-02-15 12:28:46 -0300
commit1f3c6f4534c6411313361697d98d1145a1f030fa (patch)
tree4fe12910861bced95a9349e6aedb03097837939c /lparser.c
parent25b143dd34fb587d1e35290c4b25bc08954800e2 (diff)
downloadlua-1f3c6f4534c6411313361697d98d1145a1f030fa.tar.gz
lua-1f3c6f4534c6411313361697d98d1145a1f030fa.tar.bz2
lua-1f3c6f4534c6411313361697d98d1145a1f030fa.zip
Bug: Lua can generate wrong code when _ENV is <const>
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lparser.c b/lparser.c
index 3abe3d75..a5cd5525 100644
--- a/lparser.c
+++ b/lparser.c
@@ -468,6 +468,7 @@ static void singlevar (LexState *ls, expdesc *var) {
468 expdesc key; 468 expdesc key;
469 singlevaraux(fs, ls->envn, var, 1); /* get environment variable */ 469 singlevaraux(fs, ls->envn, var, 1); /* get environment variable */
470 lua_assert(var->k != VVOID); /* this one must exist */ 470 lua_assert(var->k != VVOID); /* this one must exist */
471 luaK_exp2anyregup(fs, var); /* but could be a constant */
471 codestring(&key, varname); /* key is variable name */ 472 codestring(&key, varname); /* key is variable name */
472 luaK_indexed(fs, var, &key); /* env[varname] */ 473 luaK_indexed(fs, var, &key); /* env[varname] */
473 } 474 }