aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lapi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lapi.c b/lapi.c
index aacfd93c..40b15a3c 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.135 2010/09/03 14:14:01 roberto Exp roberto $ 2** $Id: lapi.c,v 2.136 2010/09/07 19:21:39 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*/
@@ -1107,11 +1107,15 @@ static const char *aux_upvalue (StkId fi, int n, TValue **val,
1107 return ""; 1107 return "";
1108 } 1108 }
1109 else { 1109 else {
1110 const char *name;
1110 Proto *p = f->l.p; 1111 Proto *p = f->l.p;
1111 if (!(1 <= n && n <= p->sizeupvalues)) return NULL; 1112 if (!(1 <= n && n <= p->sizeupvalues)) return NULL;
1112 *val = f->l.upvals[n-1]->v; 1113 *val = f->l.upvals[n-1]->v;
1113 if (owner) *owner = obj2gco(f->l.upvals[n - 1]); 1114 if (owner) *owner = obj2gco(f->l.upvals[n - 1]);
1114 return getstr(p->upvalues[n-1].name); 1115 name = getstr(p->upvalues[n-1].name);
1116 if (name == NULL) /* no debug information? */
1117 name = "";
1118 return name;
1115 } 1119 }
1116} 1120}
1117 1121