Global initialization checks name conflict
Initialization "global a = 10" raises an error if global 'a' is already defined, that is, it has a non-nil value.
This commit is contained in:
6
lvm.c
6
lvm.c
@@ -1940,6 +1940,12 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
|
||||
luaT_getvararg(ci, ra, rc);
|
||||
vmbreak;
|
||||
}
|
||||
vmcase(OP_ERRNNIL) {
|
||||
TValue *ra = vRA(i);
|
||||
if (!ttisnil(ra))
|
||||
halfProtect(luaG_errnnil(L, cl, GETARG_Bx(i)));
|
||||
vmbreak;
|
||||
}
|
||||
vmcase(OP_VARARGPREP) {
|
||||
ProtectNT(luaT_adjustvarargs(L, ci, cl->p));
|
||||
if (l_unlikely(trap)) { /* previous "Protect" updated trap */
|
||||
|
||||
Reference in New Issue
Block a user