mirror of
https://github.com/lua/lua
synced 2024-11-26 06:39:41 +03:00
cannot apply macro 'getstr' over NULL
This commit is contained in:
parent
87cf2bf711
commit
166ce15512
11
lapi.c
11
lapi.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 2.154 2011/10/24 14:54:05 roberto Exp roberto $
|
** $Id: lapi.c,v 2.155 2011/10/24 16:53:05 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -1195,15 +1195,16 @@ static const char *aux_upvalue (StkId fi, int n, TValue **val,
|
|||||||
}
|
}
|
||||||
case LUA_TLCL: { /* Lua closure */
|
case LUA_TLCL: { /* Lua closure */
|
||||||
LClosure *f = clLvalue(fi);
|
LClosure *f = clLvalue(fi);
|
||||||
const char *name;
|
TString *name;
|
||||||
Proto *p = f->p;
|
Proto *p = f->p;
|
||||||
if (!(1 <= n && n <= p->sizeupvalues)) return NULL;
|
if (!(1 <= n && n <= p->sizeupvalues)) return NULL;
|
||||||
*val = f->upvals[n-1]->v;
|
*val = f->upvals[n-1]->v;
|
||||||
if (owner) *owner = obj2gco(f->upvals[n - 1]);
|
if (owner) *owner = obj2gco(f->upvals[n - 1]);
|
||||||
name = getstr(p->upvalues[n-1].name);
|
name = p->upvalues[n-1].name;
|
||||||
if (name == NULL) /* no debug information? */
|
if (name == NULL) /* no debug information? */
|
||||||
name = "";
|
return "";
|
||||||
return name;
|
else
|
||||||
|
return getstr(name);
|
||||||
}
|
}
|
||||||
default: return NULL; /* not a closure */
|
default: return NULL; /* not a closure */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user