gcc/analyzer/ChangeLog:
PR analyzer/96639
* region.cc (region::get_subregions_for_binding): Check for "type"
being NULL.
gcc/testsuite/ChangeLog:
PR analyzer/96639
* gcc.dg/analyzer/pr96639.c: New test.
tree type,
auto_vec <const region *> *out) const
{
- if (get_type () == NULL_TREE)
+ if (get_type () == NULL_TREE || type == NULL_TREE)
return;
if (relative_bit_offset == 0
&& types_compatible_p (get_type (), type))
--- /dev/null
+void *calloc (__SIZE_TYPE__, __SIZE_TYPE__);
+
+int
+x7 (void)
+{
+ int **md = calloc (1, 1);
+
+ return md[0][0]; /* { dg-warning "possibly-NULL" "unchecked deref" } */
+ /* { dg-warning "leak of 'md'" "leak" { target *-*-* } .-1 } */
+}