diff options
author | dartraiden <wowemuh@gmail.com> | 2020-12-03 22:07:47 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2020-12-03 22:11:32 +0300 |
commit | b2a67a796656f20dfae0ecdf7c2870d3ece927b4 (patch) | |
tree | 9303169add151612645879732a069b779a0c92ba /libs/liblua/src/llimits.h | |
parent | ddade34e808330a64902d55fdbcb496c576599db (diff) |
liblua: update to 5.4.2
Diffstat (limited to 'libs/liblua/src/llimits.h')
-rw-r--r-- | libs/liblua/src/llimits.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libs/liblua/src/llimits.h b/libs/liblua/src/llimits.h index 48c97f9597..d03948314f 100644 --- a/libs/liblua/src/llimits.h +++ b/libs/liblua/src/llimits.h @@ -235,6 +235,17 @@ typedef l_uint32 Instruction; /* +** Maximum depth for nested C calls, syntactical nested non-terminals, +** and other features implemented through recursion in C. (Value must +** fit in a 16-bit unsigned integer. It must also be compatible with +** the size of the C stack.) +*/ +#if !defined(LUAI_MAXCCALLS) +#define LUAI_MAXCCALLS 200 +#endif + + +/* ** macros that are executed whenever program enters the Lua core ** ('lua_lock') and leaves the core ('lua_unlock') */ @@ -315,7 +326,8 @@ typedef l_uint32 Instruction; /* exponentiation */ #if !defined(luai_numpow) -#define luai_numpow(L,a,b) ((void)L, l_mathop(pow)(a,b)) +#define luai_numpow(L,a,b) \ + ((void)L, (b == 2) ? (a)*(a) : l_mathop(pow)(a,b)) #endif /* the others are quite standard operations */ @@ -344,7 +356,7 @@ typedef l_uint32 Instruction; #else /* realloc stack keeping its size */ #define condmovestack(L,pre,pos) \ - { int sz_ = (L)->stacksize; pre; luaD_reallocstack((L), sz_, 0); pos; } + { int sz_ = stacksize(L); pre; luaD_reallocstack((L), sz_, 0); pos; } #endif #if !defined(HARDMEMTESTS) |