From 757a97466f9df425c6b2709525eabc0bd27ac788 Mon Sep 17 00:00:00 2001 From: herman ten brugge Date: Thu, 17 Sep 2020 08:22:53 +0200 Subject: [PATCH] Fix testcase 114 for macos lib/bt-exe.c: - call __bound_init before sigset_exception_handler because sigaction is redirected. tests/tests2/Makefile: - run testcase 114 on macos again --- lib/bt-exe.c | 5 +++-- tests/tests2/Makefile | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/bt-exe.c b/lib/bt-exe.c index a0e8fad8..992e245c 100644 --- a/lib/bt-exe.c +++ b/lib/bt-exe.c @@ -18,6 +18,9 @@ void __bt_init(rt_context *p, int num_callers, int mode) __attribute__((weak)) void __bound_init(void*, int); struct rt_context *rc = &g_rtctxt; //fprintf(stderr, "__bt_init %d %p %p %d\n", num_callers, p->stab_sym, p->bounds_start, mode), fflush(stderr); + /* call __bound_init here due to redirection of sigaction */ + if (__bound_init && p->bounds_start) + __bound_init(p->bounds_start, mode); if (num_callers) { memcpy(rc, p, offsetof(rt_context, next)); rc->num_callers = num_callers - 1; @@ -27,8 +30,6 @@ void __bt_init(rt_context *p, int num_callers, int mode) } else { p->next = rc->next, rc->next = p; } - if (__bound_init && p->bounds_start) - __bound_init(p->bounds_start, mode); } /* copy a string and truncate it. */ diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile index dab1b974..f7f47910 100644 --- a/tests/tests2/Makefile +++ b/tests/tests2/Makefile @@ -93,10 +93,8 @@ GEN-ALWAYS = $(TCC) -bt $1 a1$(DLLSUF) a2$(DLLSUF) -Wl,-rpath=. -o a.exe && \ ./a.exe -ifndef CONFIG_OSX 114_bound_signal.test: FLAGS += -b 114_bound_signal.test: NORUN = true # tcc -run does not support fork and -b and SELINUX -endif 115_bound_setjmp.test: FLAGS += -b 116_bound_setjmp2.test: FLAGS += -b 117_builtins.test: T1 = ( $(TCC) -run $1 && $(TCC) -b -run $1 )