diff options
Diffstat (limited to 'lapi.h')
-rw-r--r-- | lapi.h | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -12,23 +12,26 @@ | |||
12 | #include "lstate.h" | 12 | #include "lstate.h" |
13 | 13 | ||
14 | 14 | ||
15 | /* Increments 'L->top', checking for stack overflows */ | 15 | /* Increments 'L->top.p', checking for stack overflows */ |
16 | #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ | 16 | #define api_incr_top(L) {L->top.p++; \ |
17 | "stack overflow");} | 17 | api_check(L, L->top.p <= L->ci->top.p, \ |
18 | "stack overflow");} | ||
18 | 19 | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | ** If a call returns too many multiple returns, the callee may not have | 22 | ** If a call returns too many multiple returns, the callee may not have |
22 | ** stack space to accommodate all results. In this case, this macro | 23 | ** stack space to accommodate all results. In this case, this macro |
23 | ** increases its stack space ('L->ci->top'). | 24 | ** increases its stack space ('L->ci->top.p'). |
24 | */ | 25 | */ |
25 | #define adjustresults(L,nres) \ | 26 | #define adjustresults(L,nres) \ |
26 | { if ((nres) <= LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } | 27 | { if ((nres) <= LUA_MULTRET && L->ci->top.p < L->top.p) \ |
28 | L->ci->top.p = L->top.p; } | ||
27 | 29 | ||
28 | 30 | ||
29 | /* Ensure the stack has at least 'n' elements */ | 31 | /* Ensure the stack has at least 'n' elements */ |
30 | #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ | 32 | #define api_checknelems(L,n) \ |
31 | "not enough elements in the stack") | 33 | api_check(L, (n) < (L->top.p - L->ci->func.p), \ |
34 | "not enough elements in the stack") | ||
32 | 35 | ||
33 | 36 | ||
34 | /* | 37 | /* |