From d0e811443d9952619ff5292d0120b4fce281f8aa Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 10 Jul 2020 14:51:12 -0400 Subject: [PATCH 301/315] FIXME: extend alloca selftest --- gcc/analyzer/region-model2.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/analyzer/region-model2.cc b/gcc/analyzer/region-model2.cc index f6be72983f0..03919488f2d 100644 --- a/gcc/analyzer/region-model2.cc +++ b/gcc/analyzer/region-model2.cc @@ -10501,7 +10501,12 @@ test_alloca () const svalue2 *ptr = mgr.get_ptr_svalue2 (int_star, reg); model.set_value (model.get_lvalue (p, &ctxt), ptr, &ctxt); // TODO: verify dynamic extents - // TODO: try popping the frame; verify that the alloca region is poisoned + + /* Verify that the pointers to the alloca region are replaced by + poisoned values when the frame is popped. */ + purge_stats2 purged; + model.pop_frame (NULL, true, &purged, NULL, &ctxt); + ASSERT_EQ (model.get_rvalue (p, &ctxt)->get_kind (), svalue2::SK_POISONED); } /* Run all of the selftests within this file. */ -- 2.26.2