From 203e12f400097ad0f2003feb5e827e0d8749f1f3 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 13 Jun 2024 07:48:40 +0300 Subject: [PATCH] Do not use GC_noop1_ptr() for functional pointers (fix of commit 0ca8be59d) Issue #627 (bdwgc). * os_dep.c [(NEED_FIND_LIMIT || UNIX_LIKE || WRAP_MARK_SOME) && CPPCHECK && ADDRESS_SANITIZER] (GC_set_and_save_fault_handler): Use GC_noop1((word)(GC_funcptr_uint)&fn) instead of GC_noop1_ptr(&fn). * os_dep.c [MPROTECT_VDB && !DARWIN && CPPCHECK && ADDRESS_SANITIZER] (GC_dirty_init): Likewise. --- os_dep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os_dep.c b/os_dep.c index dff823d83..65701141b 100644 --- a/os_dep.c +++ b/os_dep.c @@ -936,7 +936,7 @@ GC_INNER void GC_setpagesize(void) # endif # endif /* !USE_SEGV_SIGACT */ # if defined(CPPCHECK) && defined(ADDRESS_SANITIZER) - GC_noop1_ptr(&__asan_default_options); + GC_noop1((word)(GC_funcptr_uint)&__asan_default_options); # endif } #endif /* NEED_FIND_LIMIT || UNIX_LIKE || WRAP_MARK_SOME */ @@ -3504,7 +3504,7 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void) # endif # endif /* !MSWIN32 && !MSWINCE */ # if defined(CPPCHECK) && defined(ADDRESS_SANITIZER) - GC_noop1_ptr(&__asan_default_options); + GC_noop1((word)(GC_funcptr_uint)&__asan_default_options); # endif return TRUE; }