Bug path

test
‘test’: events 1-2
8int *test(void)
^~~~
|
(1) entry to ‘test’
9{
10 int *p = calls_malloc(); /* { dg-message "possible return of NULL to 'test' from 'calls_malloc'" } */
~~~~~~~~~~~~~~
|
(2) calling ‘calls_malloc’ from ‘test’
calls_malloc
‘calls_malloc’: events 3-4
3static int *calls_malloc(void)
^~~~~~~~~~~~
|
(3) entry to ‘calls_malloc’
4{
5 return malloc(sizeof(int));
~~~~~~~~~~~~~~~~~~~
|
(4) this call could return NULL
‘test’: events 5-6
10 int *p = calls_malloc(); /* { dg-message "possible return of NULL to 'test' from 'calls_malloc'" } */
^~~~~~~~~~~~~~
|
(5) possible return of NULL to ‘test’ from ‘calls_malloc’
11 *p = 42; /* { dg-warning "dereference of possibly-NULL 'p'" } */
~~~~~~~
|
(6) ‘p’ could be NULL: unchecked value from (4)