Module Name:    src
Committed By:   nikita
Date:           Mon Apr 17 19:17:49 UTC 2023

Modified Files:
        src/external/mit/lua/dist/src: lparser.c

Log Message:
lua: apply upstream bugfix for "Lua can generate wrong code when _ENV is 
<const>."


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/mit/lua/dist/src/lparser.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lparser.c
diff -u src/external/mit/lua/dist/src/lparser.c:1.12 src/external/mit/lua/dist/src/lparser.c:1.13
--- src/external/mit/lua/dist/src/lparser.c:1.12	Sun Apr 16 20:46:17 2023
+++ src/external/mit/lua/dist/src/lparser.c	Mon Apr 17 19:17:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lparser.c,v 1.12 2023/04/16 20:46:17 nikita Exp $	*/
+/*	$NetBSD: lparser.c,v 1.13 2023/04/17 19:17:49 nikita Exp $	*/
 
 /*
 ** Id: lparser.c 
@@ -472,6 +472,7 @@ static void singlevar (LexState *ls, exp
     expdesc key;
     singlevaraux(fs, ls->envn, var, 1);  /* get environment variable */
     lua_assert(var->k != VVOID);  /* this one must exist */
+    luaK_exp2anyregup(fs, var);  /* but could be a constant */
     codestring(&key, varname);  /* key is variable name */
     luaK_indexed(fs, var, &key);  /* env[varname] */
   }

Reply via email to