Bug path

test
‘test’: events 1-2
18void test (void *ptr)
^~~~
|
(1) entry to ‘test’
[...]
22 may_call_free (ptr);
~~~~~~~~~~~~~~~~~~~
|
(2) calling ‘may_call_free’ from ‘test’
may_call_free
‘may_call_free’: events 3-6
10may_call_free (void *victim)
^~~~~~~~~~~~~
|
(3) entry to ‘may_call_free’
11{
12 if (some_condition ())
~
|
(4) following ‘false’ branch...
[...]
15 free (victim); /* { dg-warning "double-'free' of 'victim'" } */
~~~~~~~~~~~~~
|
(5) ...to here
(6) first ‘free’ here
‘test’: events 7-8
22 may_call_free (ptr);
^~~~~~~~~~~~~~~~~~~
|
(7) returning to ‘test’ from ‘may_call_free’
[...]
26 may_call_free (ptr);
~~~~~~~~~~~~~~~~~~~
|
(8) passing freed pointer ‘ptr’ in call to ‘may_call_free’ from ‘test’
may_call_free
‘may_call_free’: events 9-12
10may_call_free (void *victim)
^~~~~~~~~~~~~
|
(9) entry to ‘may_call_free’
11{
12 if (some_condition ())
~
|
(10) following ‘false’ branch...
[...]
15 free (victim); /* { dg-warning "double-'free' of 'victim'" } */
~~~~~~~~~~~~~
|
(11) ...to here
(12) second ‘free’ here; first ‘free’ was at (6)