From c61159cfc667e435d931cc5ea2ad7ecde98ccca5 Mon Sep 17 00:00:00 2001 From: Egor Sheremetov Date: Mon, 14 Aug 2023 09:40:56 +0200 Subject: [PATCH] Different PRE_GC and POST_GC attempt, floating 0 bug is present again --- runtime/runtime.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime/runtime.c b/runtime/runtime.c index 79e7e25ae..140be4ba3 100644 --- a/runtime/runtime.c +++ b/runtime/runtime.c @@ -37,6 +37,12 @@ void __post_gc_subst () { } assert(__gc_stack_top != 0); \ assert(__builtin_frame_address(0) <= (void *)__gc_stack_top); +//#define PRE_GC() \ +// bool flag = true; \ +// if (__gc_stack_top == 0) { flag = false; } \ +// if (!flag) __gc_stack_top = (size_t)__builtin_frame_address(0); \ +// assert(__builtin_frame_address(0) <= (void *)__gc_stack_top); + #define POST_GC() \ assert(__builtin_frame_address(0) <= (void *)__gc_stack_top); \ __post_gc(); \ @@ -46,6 +52,9 @@ void __post_gc_subst () { } assert(false); \ } +//#define POST_GC() \ +// if (!flag) { __gc_stack_top = 0; } + extern size_t __gc_stack_top, __gc_stack_bottom; static void vfailure (char *s, va_list args) {