Tag LUA_TUPVALTBC replaced by a flag

It is simpler to signal a to-be-closed upvalue with a boolean flag,
instead of using a different tag.
This commit is contained in:
Roberto Ierusalimschy
2019-07-19 11:12:31 -03:00
parent 9cdf6b7082
commit dc07719b0d
5 changed files with 13 additions and 18 deletions

View File

@@ -568,6 +568,7 @@ typedef struct Proto {
*/
typedef struct UpVal {
CommonHeader;
lu_byte tbc; /* true if it represents a to-be-closed variable */
TValue *v; /* points to stack or to its own value */
union {
struct { /* (when open) */
@@ -579,9 +580,6 @@ typedef struct UpVal {
} UpVal;
/* variant for "To Be Closed" upvalues */
#define LUA_TUPVALTBC (LUA_TUPVAL | (1 << 4))
#define ClosureHeader \
CommonHeader; lu_byte nupvalues; GCObject *gclist