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'.
This commit is contained in:
2
lcode.c
2
lcode.c
@@ -1242,7 +1242,7 @@ static void codenot (FuncState *fs, expdesc *e) {
|
||||
** Check whether expression 'e' is a short literal string
|
||||
*/
|
||||
static int isKstr (FuncState *fs, expdesc *e) {
|
||||
return (e->k == VK && !hasjumps(e) && e->u.info <= MAXARG_B &&
|
||||
return (e->k == VK && !hasjumps(e) && e->u.info <= MAXINDEXRK &&
|
||||
ttisshrstring(&fs->f->k[e->u.info]));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user