middle-end: Fix stalled swapped condition code value [PR115836]
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / callbacks-1.c
blob52c8fde540a7d36a660087e4f99f694ca83e06d1
1 /* Reproducer for PR analyzer/97258: we should report the double-free
2 inside a static callback if the callback escapes. */
4 #include <stdlib.h>
6 static void callback_1 (void *p)
8 free (p);
9 free (p); /* { dg-warning "double-'free' of 'p'" } */
12 struct ops {
13 void (*cb) (void *);
16 static const struct ops ops_1 = {
17 .cb = callback_1
20 extern void registration (const void *);
22 void register_1 (void)
24 registration (&ops_1);