aboutsummaryrefslogtreecommitdiff
path: root/src/3rdParty/lua/lapi.h
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-12-02 10:40:09 +0800
committerLi Jin <dragon-fly@qq.com>2022-12-02 10:40:09 +0800
commit298b18dbe852300199cc529c942a181bead5f135 (patch)
treef4b5ae89b6920fa0a12c693118f85334f19754f8 /src/3rdParty/lua/lapi.h
parenta6a65ba26a9d320611abcbfba49fa724edfb4dad (diff)
downloadyuescript-298b18dbe852300199cc529c942a181bead5f135.tar.gz
yuescript-298b18dbe852300199cc529c942a181bead5f135.tar.bz2
yuescript-298b18dbe852300199cc529c942a181bead5f135.zip
update Lua.
Diffstat (limited to 'src/3rdParty/lua/lapi.h')
-rw-r--r--src/3rdParty/lua/lapi.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/3rdParty/lua/lapi.h b/src/3rdParty/lua/lapi.h
index 9e99cc4..a742427 100644
--- a/src/3rdParty/lua/lapi.h
+++ b/src/3rdParty/lua/lapi.h
@@ -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/*