diff options
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 22 |
1 files changed, 9 insertions, 13 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.145 2017/10/31 17:54:35 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.146 2017/11/02 11:28:56 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -86,7 +86,6 @@ typedef struct stringtable { | |||
86 | */ | 86 | */ |
87 | typedef struct CallInfo { | 87 | typedef struct CallInfo { |
88 | StkId func; /* function index in the stack */ | 88 | StkId func; /* function index in the stack */ |
89 | StkId top; /* top for this function */ | ||
90 | struct CallInfo *previous, *next; /* dynamic call link */ | 89 | struct CallInfo *previous, *next; /* dynamic call link */ |
91 | union { | 90 | union { |
92 | struct { /* only for Lua functions */ | 91 | struct { /* only for Lua functions */ |
@@ -102,8 +101,6 @@ typedef struct CallInfo { | |||
102 | ptrdiff_t funcidx; /* called-function index */ | 101 | ptrdiff_t funcidx; /* called-function index */ |
103 | int nyield; /* number of values yielded */ | 102 | int nyield; /* number of values yielded */ |
104 | } u2; | 103 | } u2; |
105 | short nresults; /* expected number of results from this function */ | ||
106 | unsigned short callstatus; | ||
107 | } CallInfo; | 104 | } CallInfo; |
108 | 105 | ||
109 | 106 | ||
@@ -111,17 +108,16 @@ typedef struct CallInfo { | |||
111 | ** Bits in CallInfo status | 108 | ** Bits in CallInfo status |
112 | */ | 109 | */ |
113 | #define CIST_OAH (1<<0) /* original value of 'allowhook' */ | 110 | #define CIST_OAH (1<<0) /* original value of 'allowhook' */ |
114 | #define CIST_LUA (1<<1) /* call is running a Lua function */ | 111 | #define CIST_HOOKED (1<<1) /* call is running a debug hook */ |
115 | #define CIST_HOOKED (1<<2) /* call is running a debug hook */ | 112 | #define CIST_FRESH (1<<2) /* call is running on a fresh invocation |
116 | #define CIST_FRESH (1<<3) /* call is running on a fresh invocation | ||
117 | of luaV_execute */ | 113 | of luaV_execute */ |
118 | #define CIST_YPCALL (1<<4) /* call is a yieldable protected call */ | 114 | #define CIST_YPCALL (1<<3) /* call is a yieldable protected call */ |
119 | #define CIST_TAIL (1<<5) /* call was tail called */ | 115 | #define CIST_TAIL (1<<4) /* call was tail called */ |
120 | #define CIST_HOOKYIELD (1<<6) /* last hook called yielded */ | 116 | #define CIST_HOOKYIELD (1<<5) /* last hook called yielded */ |
121 | #define CIST_LEQ (1<<7) /* using __lt for __le */ | 117 | #define CIST_LEQ (1<<6) /* using __lt for __le */ |
122 | #define CIST_FIN (1<<8) /* call is running a finalizer */ | 118 | #define CIST_FIN (1<<7) /* call is running a finalizer */ |
123 | 119 | ||
124 | #define isLua(ci) ((ci)->callstatus & CIST_LUA) | 120 | #define isLua(func) isLfunction(s2v(func)) |
125 | 121 | ||
126 | /* assume that CIST_OAH has offset 0 and that 'v' is strictly 0/1 */ | 122 | /* assume that CIST_OAH has offset 0 and that 'v' is strictly 0/1 */ |
127 | #define setoah(st,v) ((st) = ((st) & ~CIST_OAH) | (v)) | 123 | #define setoah(st,v) ((st) = ((st) & ~CIST_OAH) | (v)) |