aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ldo.c b/ldo.c
index 776519dc..f232b588 100644
--- a/ldo.c
+++ b/ldo.c
@@ -174,6 +174,20 @@ TStatus luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
174#define STACKERRSPACE 200 174#define STACKERRSPACE 200
175 175
176 176
177/*
178** LUAI_MAXSTACK limits the size of the Lua stack.
179** It must fit into INT_MAX/2.
180*/
181
182#if !defined(LUAI_MAXSTACK)
183#if 1000000 < (INT_MAX / 2)
184#define LUAI_MAXSTACK 1000000
185#else
186#define LUAI_MAXSTACK (INT_MAX / 2u)
187#endif
188#endif
189
190
177/* maximum stack size that respects size_t */ 191/* maximum stack size that respects size_t */
178#define MAXSTACK_BYSIZET ((MAX_SIZET / sizeof(StackValue)) - STACKERRSPACE) 192#define MAXSTACK_BYSIZET ((MAX_SIZET / sizeof(StackValue)) - STACKERRSPACE)
179 193