summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2021-12-27 21:27:41 +0300
committerIvan Maidanski <ivmai@mail.ru>2021-12-27 21:27:41 +0300
commit16ffd18660fdf09ce2f671a2e3e8245242c94607 (patch)
tree9138f61bc0b0266a421d729236bc7958abdbb2d9
parenteca62c130353147121431b5893f11246de001269 (diff)
downloadbdwgc-16ffd18660fdf09ce2f671a2e3e8245242c94607.tar.gz
Declare cleared_p as volatile in realloc for any GCC version
(fix of commit eca62c130) Issue #406 (bdwgc). * mallocx.c [_FORTIFY_SOURCE && !__clang__] (GC_realloc): Declare cleared_p variable as volatile for any GCC version.
-rw-r--r--mallocx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mallocx.c b/mallocx.c
index 0692565e..7f7f0966 100644
--- a/mallocx.c
+++ b/mallocx.c
@@ -79,7 +79,7 @@ GC_API void * GC_CALL GC_realloc(void * p, size_t lb)
struct hblk * h;
hdr * hhdr;
void * result;
-# if defined(_FORTIFY_SOURCE) && GC_GNUC_PREREQ(9, 0) && !defined(__clang__)
+# if defined(_FORTIFY_SOURCE) && defined(__GNUC__) && !defined(__clang__)
volatile /* Use cleared_p instead of p as a workaround to avoid */
/* passing alloc_size(lb) attribute associated with p */
/* to memset (including memset call inside GC_free). */