summaryrefslogtreecommitdiff
path: root/libs/liblua/src/lobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/liblua/src/lobject.h')
-rw-r--r--libs/liblua/src/lobject.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/liblua/src/lobject.h b/libs/liblua/src/lobject.h
index 1cc8e757bf..950bebbde2 100644
--- a/libs/liblua/src/lobject.h
+++ b/libs/liblua/src/lobject.h
@@ -136,10 +136,19 @@ typedef struct TValue {
/*
-** Entries in the Lua stack
+** Entries in a Lua stack. Field 'tbclist' forms a list of all
+** to-be-closed variables active in this stack. Dummy entries are
+** used when the distance between two tbc variables does not fit
+** in an unsigned short. They are represented by delta==0, and
+** their real delta is always the maximum value that fits in
+** that field.
*/
typedef union StackValue {
TValue val;
+ struct {
+ TValuefields;
+ unsigned short delta;
+ } tbclist;
} StackValue;
@@ -570,10 +579,11 @@ typedef struct Proto {
#define LUA_VCCL makevariant(LUA_TFUNCTION, 2) /* C closure */
#define ttisfunction(o) checktype(o, LUA_TFUNCTION)
-#define ttisclosure(o) ((rawtt(o) & 0x1F) == LUA_VLCL)
#define ttisLclosure(o) checktag((o), ctb(LUA_VLCL))
#define ttislcf(o) checktag((o), LUA_VLCF)
#define ttisCclosure(o) checktag((o), ctb(LUA_VCCL))
+#define ttisclosure(o) (ttisLclosure(o) || ttisCclosure(o))
+
#define isLfunction(o) ttisLclosure(o)