analyzer: fix ICE reporting NULL dereference (PR 93647)
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 10 Feb 2020 15:01:46 +0000 (10:01 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Mon, 10 Feb 2020 22:56:45 +0000 (17:56 -0500)
commite953f9588d4a7ea4183d14914f915329cc37941f
tree7f0dee21c8dc9de1a24fa2abfe7ccf77099adcc3
parentf57aa9503ff170ff6c8549718bd736f6c8168bab
analyzer: fix ICE reporting NULL dereference (PR 93647)

gcc/analyzer/ChangeLog:
PR analyzer/93647
* diagnostic-manager.cc
(diagnostic_manager::prune_for_sm_diagnostic): Bulletproof against
VAR being constant.
* region-model.cc (region_model::get_lvalue_1): Provide a better
error message when encountering an unhandled tree code.

gcc/testsuite/ChangeLog:
PR analyzer/93647
* gcc.dg/analyzer/torture/pr93647.c: New test.
gcc/analyzer/ChangeLog
gcc/analyzer/diagnostic-manager.cc
gcc/analyzer/region-model.cc
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/analyzer/torture/pr93647.c [new file with mode: 0644]