From 78c60ae6957dc27fd1ab129ba472a39c263b7523 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sat, 7 Sep 2024 01:14:32 +0200 Subject: [PATCH] Increase stack size for msys. --- CMakeLists.txt | 6 ++++++ src/compiler/sema_expr.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d10797f81..1c31e4ac0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -425,6 +425,11 @@ if (WIN32) target_link_libraries(c3c Winhttp.lib) endif() +if(MINGW) + message("Increase stack for msys") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,8388608") +endif () + if (CURL_FOUND) target_link_libraries(c3c ${CURL_LIBRARIES}) target_include_directories(c3c PRIVATE ${CURL_INCLUDES}) @@ -433,6 +438,7 @@ else() target_compile_definitions(c3c PUBLIC CURL_FOUND=0) endif() + if(MSVC) message("Adding MSVC options") target_compile_options(c3c PRIVATE /wd4068 /wd4090 /WX /Wv:18) diff --git a/src/compiler/sema_expr.c b/src/compiler/sema_expr.c index ecb081361..223321d0b 100644 --- a/src/compiler/sema_expr.c +++ b/src/compiler/sema_expr.c @@ -1940,7 +1940,7 @@ bool sema_expr_analyse_macro_call(SemaContext *context, Expr *call_expr, Expr *s bool is_always_const = decl->func_decl.signature.attrs.always_const; ASSERT_SPAN(call_expr, decl->decl_kind == DECL_MACRO); - if (context->macro_call_depth > 200) + if (context->macro_call_depth > 256) { decl->decl_kind = DECL_POISONED; RETURN_SEMA_ERROR(call_expr, "Failure evaluating macro, max call depth reached, "