diff --git a/src/gasman.c b/src/gasman.c index 2981279b98..f2d27128b5 100644 --- a/src/gasman.c +++ b/src/gasman.c @@ -472,9 +472,7 @@ static void CANARY_ALLOW_ACCESS_BAG(Bag bag) BagHeader * header = BAG_HEADER(bag); VALGRIND_MAKE_MEM_DEFINED( - (char *)header + sizeof(header->memory_canary_padding1), - sizeof(*header) - sizeof(header->memory_canary_padding1) - - sizeof(header->memory_canary_padding2)); + header, sizeof(*header) - sizeof(header->memory_canary_padding)); } // Reverse CANARY_ALL_ACCESS_BAG, making the masterpointer, bag contents and @@ -488,9 +486,7 @@ static void CANARY_FORBID_ACCESS_BAG(Bag bag) BagHeader * header = BAG_HEADER(bag); VALGRIND_MAKE_MEM_NOACCESS( - (char *)header + sizeof(header->memory_canary_padding1), - sizeof(*header) - sizeof(header->memory_canary_padding1) - - sizeof(header->memory_canary_padding2)); + header, sizeof(*header) - sizeof(header->memory_canary_padding)); } // Mark all bags as accessible diff --git a/src/gasman.h b/src/gasman.h index a60ce4d4ac..6e44eb0de5 100644 --- a/src/gasman.h +++ b/src/gasman.h @@ -77,11 +77,6 @@ typedef UInt * * Bag; ** */ typedef struct { -#if defined(GAP_MEMORY_CANARY) - // The following variable is marked as not readable or writable - // in valgrind, to check for code reading before the start of the header. - uint64_t memory_canary_padding1[8]; -#endif uint8_t type : 8; uint8_t flags : 8; // the following unnamed field ensures that on 32 bit systems, @@ -94,7 +89,7 @@ typedef struct { #if defined(GAP_MEMORY_CANARY) // The following variable is marked as not readable or writable // in valgrind, to check for code reading before the start of a Bag. - uint64_t memory_canary_padding2[8]; + uint64_t memory_canary_padding[8]; #endif } BagHeader;