Bug path

test_1
‘test_1’: events 1-2
99void test_1 (const char *str)
^~~~~~
|
(1) entry to ‘test_1’
100{
101 base_obj *obj = new_string_obj (str);
~~~~~~~~~~~~~~~~~~~~
|
(2) calling ‘new_string_obj’ from ‘test_1’
new_string_obj
‘new_string_obj’: events 3-4
69base_obj *new_string_obj (const char *str)
^~~~~~~~~~~~~~
|
(3) entry to ‘new_string_obj’
[...]
75 = (string_obj *)alloc_obj (&str_type, sizeof (string_obj) + len + 1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
(4) calling ‘alloc_obj’ from ‘new_string_obj’
alloc_obj
‘alloc_obj’: events 5-6
59base_obj *alloc_obj (type_obj *ob_type, size_t sz)
^~~~~~~~~
|
(5) entry to ‘alloc_obj’
[...]
62 if (!obj)
~
|
(6) following ‘true’ branch (when ‘obj’ is NULL)...
‘alloc_obj’: event 7
63 return NULL;
^~~~
|
(7) ...to here
‘alloc_obj’: event 8
63 return NULL;
^~~~
|
(8) ‘0’ is NULL
‘new_string_obj’: events 9-13
75 = (string_obj *)alloc_obj (&str_type, sizeof (string_obj) + len + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
(9) returning to ‘new_string_obj’ from ‘alloc_obj’
[...]
86 return (base_obj *)str_obj;
~~~~~~~~~~~~~~~~~~~
|
(10) ‘str_obj’ is NULL
(11) ‘str_obj’ is NULL
(12) ‘str_obj’ is NULL
(13) ‘str_obj’ is NULL
‘test_1’: events 14-15
101 base_obj *obj = new_string_obj (str);
^~~~~~~~~~~~~~~~~~~~
|
(14) return of NULL to ‘test_1’ from ‘new_string_obj’
102 unref (obj);
~~~~~~~~~~~
|
(15) calling ‘unref’ from ‘test_1’
unref
‘unref’: events 16-17
89void unref (base_obj *obj)
^~~~~
|
(16) entry to ‘unref’
90{
91 if (--obj->ob_refcnt == 0) /* { dg-bogus "dereference of uninitialized pointer 'obj'" } */
~~~~~~~~~~~~~~
|
(17) dereference of NULL ‘obj’