Skip to content

Commit bf1faca

Browse files
committed
Always enable stack checking
Seems to work in Emscripten and it can be disabled with JS_SetMaxStackSize(rt, 0).
1 parent a5b9e54 commit bf1faca

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

quickjs.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@
6767
#define CONFIG_PRINTF_RNDN
6868
#endif
6969

70-
#if !defined(EMSCRIPTEN)
71-
/* enable stack limitation */
72-
#define CONFIG_STACK_CHECK
73-
#endif
74-
75-
7670
/* dump object free */
7771
//#define DUMP_FREE
7872
//#define DUMP_CLOSURE
@@ -1555,18 +1549,6 @@ static int init_class_range(JSRuntime *rt, JSClassShortDef const *tab,
15551549
return 0;
15561550
}
15571551

1558-
#if !defined(CONFIG_STACK_CHECK)
1559-
/* no stack limitation */
1560-
static inline uintptr_t js_get_stack_pointer(void)
1561-
{
1562-
return 0;
1563-
}
1564-
1565-
static inline BOOL js_check_stack_overflow(JSRuntime *rt, size_t alloca_size)
1566-
{
1567-
return FALSE;
1568-
}
1569-
#else
15701552
/* Note: OS and CPU dependent */
15711553
static inline uintptr_t js_get_stack_pointer(void)
15721554
{
@@ -1579,7 +1561,6 @@ static inline BOOL js_check_stack_overflow(JSRuntime *rt, size_t alloca_size)
15791561
sp = js_get_stack_pointer() - alloca_size;
15801562
return unlikely(sp < rt->stack_limit);
15811563
}
1582-
#endif
15831564

15841565
JSRuntime *JS_NewRuntime2(const JSMallocFunctions *mf, void *opaque)
15851566
{

0 commit comments

Comments
 (0)