Enable stack overflow check when recursive calls ##js

* `""js var a = foo; function foo() { a(); } a();`
This commit is contained in:
pancake 2023-01-02 01:34:47 +01:00 committed by pancake
parent 695fe0831e
commit aa63e120b2
3 changed files with 7 additions and 0 deletions

View File

@ -15,6 +15,7 @@ endif
.PHONY: $(QJS_NAME)
QJS_CFLAGS+=-D QJS_LIBC=$(QJS_LIBC)
QJS_CFLAGS+=-D CONFIG_STACK_CHECK=y
QJS_CFLAGS+=-U CONFIG_BIGNUM
QJS_CFLAGS+=-U DUMP_LEAKS
QJS_CFLAGS+=-U NDEBUG

View File

@ -1,6 +1,7 @@
include ../../libr/config.mk
# include $(SHLR)/qjs/config.mk
LINK_QJS_ARCHIVE=0
QJS_STACK_CHECK=1
QJS_BIGNUM=1
QJS_LIBC=0
@ -25,3 +26,6 @@ CFLAGS+=-I$(SHLR)/qjs/src
ifeq ($(QJS_BIGNUM),1)
CFLAGS+=-DCONFIG_BIGNUM=$(QJS_BIGNUM)
endif
ifeq ($(QJS_STACK_CHECK),1)
CFLAGS+=-DCONFIG_STACK_CHECK=y
endif

View File

@ -43,6 +43,8 @@ endif
# installation directory
prefix=/usr/local
# avoid stack overflow on recursive calls
CONFIG_STACK_CHECK=y
# use the gprof profiler
#CONFIG_PROFILE=y
# use address sanitizer