diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-10-31 15:48:51 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-10-31 15:48:51 -0200 |
| commit | 166ce15512a32e374ee77fd72c2696f35c503efe (patch) | |
| tree | 2abfe6929eea423f9e716e51fd206137a5a5e447 | |
| parent | 87cf2bf711eb1a754ed8fee40b21ae74fe18d643 (diff) | |
| download | lua-166ce15512a32e374ee77fd72c2696f35c503efe.tar.gz lua-166ce15512a32e374ee77fd72c2696f35c503efe.tar.bz2 lua-166ce15512a32e374ee77fd72c2696f35c503efe.zip | |
cannot apply macro 'getstr' over NULL
| -rw-r--r-- | lapi.c | 11 |
1 files changed, 6 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 2.154 2011/10/24 14:54:05 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.155 2011/10/24 16:53:05 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -1195,15 +1195,16 @@ static const char *aux_upvalue (StkId fi, int n, TValue **val, | |||
| 1195 | } | 1195 | } |
| 1196 | case LUA_TLCL: { /* Lua closure */ | 1196 | case LUA_TLCL: { /* Lua closure */ |
| 1197 | LClosure *f = clLvalue(fi); | 1197 | LClosure *f = clLvalue(fi); |
| 1198 | const char *name; | 1198 | TString *name; |
| 1199 | Proto *p = f->p; | 1199 | Proto *p = f->p; |
| 1200 | if (!(1 <= n && n <= p->sizeupvalues)) return NULL; | 1200 | if (!(1 <= n && n <= p->sizeupvalues)) return NULL; |
| 1201 | *val = f->upvals[n-1]->v; | 1201 | *val = f->upvals[n-1]->v; |
| 1202 | if (owner) *owner = obj2gco(f->upvals[n - 1]); | 1202 | if (owner) *owner = obj2gco(f->upvals[n - 1]); |
| 1203 | name = getstr(p->upvalues[n-1].name); | 1203 | name = p->upvalues[n-1].name; |
| 1204 | if (name == NULL) /* no debug information? */ | 1204 | if (name == NULL) /* no debug information? */ |
| 1205 | name = ""; | 1205 | return ""; |
| 1206 | return name; | 1206 | else |
| 1207 | return getstr(name); | ||
| 1207 | } | 1208 | } |
| 1208 | default: return NULL; /* not a closure */ | 1209 | default: return NULL; /* not a closure */ |
| 1209 | } | 1210 | } |
