This patch extends region_model::get_representative_tree so that dumps are able to refer to string literals, which I've found useful in investigating a state-bloat issue. Doing so uncovered a bug in the handling of views I introduced in r10-7024-ge516294a where the code was erroneously using TREE_TYPE on the view region's type, rather than just using its type, which the patch also fixes. gcc/analyzer/ChangeLog: * analyzer.h (class array_region): New forward decl. * program-state.cc (selftest::test_program_state_dumping_2): New. (selftest::analyzer_program_state_cc_tests): Call it. * region-model.cc (array_region::constant_from_key): New. (region_model::get_representative_tree): Handle region_svalue by generating an ADDR_EXPR. (region_model::get_representative_path_var): In view handling, remove erroneous TREE_TYPE when determining the type of the tree. Handle array regions and STRING_CST. (selftest::assert_dump_tree_eq): New. (ASSERT_DUMP_TREE_EQ): New macro. (selftest::test_get_representative_tree): New selftest. (selftest::analyzer_region_model_cc_tests): Call it. * region-model.h (region::dyn_cast_array_region): New vfunc. (array_region::dyn_cast_array_region): New vfunc implementation. (array_region::constant_from_key): New decl. gcc/testsuite/ChangeLog: * gcc.dg/analyzer/malloc-4.c: Update expected output of leak to reflect fix to region_model::get_representative_path_var, adding the missing "*" from the cast.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
ChangeLog | Loading commit data... | |
analysis-plan.cc | Loading commit data... | |
analysis-plan.h | Loading commit data... | |
analyzer-logging.cc | Loading commit data... | |
analyzer-logging.h | Loading commit data... | |
analyzer-pass.cc | Loading commit data... | |
analyzer-selftests.cc | Loading commit data... | |
analyzer-selftests.h | Loading commit data... | |
analyzer.cc | Loading commit data... | |
analyzer.h | Loading commit data... | |
analyzer.opt | Loading commit data... | |
bar-chart.cc | Loading commit data... | |
bar-chart.h | Loading commit data... | |
call-string.cc | Loading commit data... | |
call-string.h | Loading commit data... | |
checker-path.cc | Loading commit data... | |
checker-path.h | Loading commit data... | |
constraint-manager.cc | Loading commit data... | |
constraint-manager.h | Loading commit data... | |
diagnostic-manager.cc | Loading commit data... | |
diagnostic-manager.h | Loading commit data... | |
engine.cc | Loading commit data... | |
engine.h | Loading commit data... | |
exploded-graph.h | Loading commit data... | |
function-set.cc | Loading commit data... | |
function-set.h | Loading commit data... | |
pending-diagnostic.cc | Loading commit data... | |
pending-diagnostic.h | Loading commit data... | |
program-point.cc | Loading commit data... | |
program-point.h | Loading commit data... | |
program-state.cc | Loading commit data... | |
program-state.h | Loading commit data... | |
reachability.h | Loading commit data... | |
region-model.cc | Loading commit data... | |
region-model.h | Loading commit data... | |
sm-file.cc | Loading commit data... | |
sm-malloc.cc | Loading commit data... | |
sm-malloc.dot | Loading commit data... | |
sm-pattern-test.cc | Loading commit data... | |
sm-sensitive.cc | Loading commit data... | |
sm-signal.cc | Loading commit data... | |
sm-taint.cc | Loading commit data... | |
sm.cc | Loading commit data... | |
sm.h | Loading commit data... | |
state-purge.cc | Loading commit data... | |
state-purge.h | Loading commit data... | |
supergraph.cc | Loading commit data... | |
supergraph.h | Loading commit data... |