File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed
regression/cbmc-java/exceptions25 Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 1+ int main (void )
2+ {
3+ int x ;
4+ __CPROVER_assume (x < 10 );
5+ __CPROVER_assert (x != 0 , "" );
6+ return 0 ;
7+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+
4+ ^EXIT=10$
5+ ^SIGNAL=0$
6+ VERIFICATION FAILED
7+ --
8+ ^warning: ignoring
9+ --
10+ When compiling CBMC with -DDEBUG uncaught exception analysis prints an
11+ exceptions map per function. This test ensures that meta-functions which are
12+ replaced by explicit GOTO instructions (e.g. __CPROVER_assert, __CPROVER_assume)
13+ and thus do not occur as explicit function calls in the final GOTO program are
14+ handled correctly.
Original file line number Diff line number Diff line change @@ -193,9 +193,11 @@ void uncaught_exceptions_analysist::output(
193193 {
194194 const auto fn=it->first ;
195195 const exceptions_mapt::const_iterator found=exceptions_map.find (fn);
196- INVARIANT (
197- found!=exceptions_map.end (),
198- " each function expected to be recorded in `exceptions_map`" );
196+ // Functions like __CPROVER_assert and __CPROVER_assume are replaced by
197+ // explicit GOTO instructions and will not show up in exceptions_map.
198+ if (found==exceptions_map.end ())
199+ continue ;
200+
199201 const auto &fs=found->second ;
200202 if (!fs.empty ())
201203 {
You can’t perform that action at this time.
0 commit comments