diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-11-29 16:02:44 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-11-29 16:02:44 -0200 |
commit | 6d04537ea660fd12fc16c328366b701fabaf4919 (patch) | |
tree | 41eab6e4d87552e29731db552f7d58d679c56973 /lapi.c | |
parent | 7696c6474fe51ed59fee324e78c1233af74febdd (diff) | |
download | lua-6d04537ea660fd12fc16c328366b701fabaf4919.tar.gz lua-6d04537ea660fd12fc16c328366b701fabaf4919.tar.bz2 lua-6d04537ea660fd12fc16c328366b701fabaf4919.zip |
A to-be-closed variable must have a closable value (or be nil)
It is an error for a to-be-closed variable to have a non-closable
non-nil value when it is being closed. This situation does not seem to
be useful and often hints to an error. (Particularly in the C API, it is
easy to change a to-be-closed index by mistake.)
Diffstat (limited to '')
-rw-r--r-- | lapi.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1299,7 +1299,7 @@ static const char *aux_upvalue (TValue *fi, int n, TValue **val, | |||
1299 | *val = f->upvals[n-1]->v; | 1299 | *val = f->upvals[n-1]->v; |
1300 | if (owner) *owner = obj2gco(f->upvals[n - 1]); | 1300 | if (owner) *owner = obj2gco(f->upvals[n - 1]); |
1301 | name = p->upvalues[n-1].name; | 1301 | name = p->upvalues[n-1].name; |
1302 | return (name == NULL) ? "(*no name)" : getstr(name); | 1302 | return (name == NULL) ? "(no name)" : getstr(name); |
1303 | } | 1303 | } |
1304 | default: return NULL; /* not a closure */ | 1304 | default: return NULL; /* not a closure */ |
1305 | } | 1305 | } |