Skip to content

Commit 3bf1001

Browse files
committed
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.
1 parent 19af189 commit 3bf1001

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sql/item_jsonfunc.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
#define ALLOCATE_MEM_ON_STACK(A) do \
3232
{ \
3333
uchar *array= (uchar*)alloca(A); \
34-
array[0]= 1; \
35-
array[0]++; \
36-
array[0] ? array[0]++ : array[0]--; \
34+
bzero(array, A); \
35+
my_checksum(0, array, A); \
3736
} while(0)
3837

3938
/*

0 commit comments

Comments
 (0)