Skip to content
Permalink
Browse files
MDEV-28762: Fixup for clang
Unlike GCC, clang could optimize away alloca() and thus the
ALLOCATE_MEM_ON_STACK() instrumentation. To make it harder, let us
invoke a non-inline function on the entire allocated buffer.
  • Loading branch information
dr-m committed Jul 26, 2022
1 parent 19af189 commit 3bf1001
Showing 1 changed file with 2 additions and 3 deletions.
@@ -31,9 +31,8 @@
#define ALLOCATE_MEM_ON_STACK(A) do \
{ \
uchar *array= (uchar*)alloca(A); \
array[0]= 1; \
array[0]++; \
array[0] ? array[0]++ : array[0]--; \
bzero(array, A); \
my_checksum(0, array, A); \
} while(0)

/*

0 comments on commit 3bf1001

Please sign in to comment.