diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2025-10-29 13:14:48 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2025-10-29 13:14:48 -0300 |
| commit | d4eff00234dc55dac4cb86b6187f5607c1254f9b (patch) | |
| tree | 3f080f35cfd23249166a4311946cf0ea766d71d0 /lcode.c | |
| parent | fca974486d12aa29bb6d731fdb5b25055157ece8 (diff) | |
| download | lua-d4eff00234dc55dac4cb86b6187f5607c1254f9b.tar.gz lua-d4eff00234dc55dac4cb86b6187f5607c1254f9b.tar.bz2 lua-d4eff00234dc55dac4cb86b6187f5607c1254f9b.zip | |
Fixed initialization of global variables
When calling 'luaK_storevar', the 'expdesc' for the variable must be
created before the one for the expression, to satisfy the assumptions
for register allocation. So, in a statement like 'global a = exp', where
'a' is actually '_ENV.a', this variable must be handled before the
initializing expression 'exp'.
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -1242,7 +1242,7 @@ static void codenot (FuncState *fs, expdesc *e) { | |||
| 1242 | ** Check whether expression 'e' is a short literal string | 1242 | ** Check whether expression 'e' is a short literal string |
| 1243 | */ | 1243 | */ |
| 1244 | static int isKstr (FuncState *fs, expdesc *e) { | 1244 | static int isKstr (FuncState *fs, expdesc *e) { |
| 1245 | return (e->k == VK && !hasjumps(e) && e->u.info <= MAXARG_B && | 1245 | return (e->k == VK && !hasjumps(e) && e->u.info <= MAXINDEXRK && |
| 1246 | ttisshrstring(&fs->f->k[e->u.info])); | 1246 | ttisshrstring(&fs->f->k[e->u.info])); |
| 1247 | } | 1247 | } |
| 1248 | 1248 | ||
