File tree Expand file tree Collapse file tree 4 files changed +9
-3
lines changed
regression/cbmc/Memory_leak_abort Expand file tree Collapse file tree 4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 11#include <stdlib.h>
22
3- extern void __VERIFIER_error () __attribute__ ((__noreturn__ ));
3+ extern void __VERIFIER_error () __attribute__((__noreturn__ ));
44
55int main ()
66{
@@ -11,6 +11,8 @@ int main()
1111 exit (1 );
1212 if (* p == 2 )
1313 _Exit (1 );
14+ if (* p == 3 )
15+ __VERIFIER_error ();
1416 free (p );
1517 return 0 ;
1618}
Original file line number Diff line number Diff line change 11CORE
22main.c
3- --memory-leak-check
3+ --memory-leak-check --no-assertions
44^EXIT=10$
55^SIGNAL=0$
66^VERIFICATION FAILED$
77_Exit\.memory-leak\.1.*FAILURE
88__CPROVER__start\.memory-leak\.1.*SUCCESS
99abort\.memory-leak\.1.*FAILURE
1010exit\.memory-leak\.1.*FAILURE
11+ main\.memory-leak\.1.*FAILURE
1112--
13+ main\.assertion\.1.*FAILURE
1214^warning: ignoring
Original file line number Diff line number Diff line change @@ -1708,7 +1708,8 @@ void goto_checkt::goto_check(
17081708 if (
17091709 enable_memory_leak_check && simplified_guard.is_false () &&
17101710 (i.function == " abort" || i.function == " exit" ||
1711- i.function == " _Exit" ))
1711+ i.function == " _Exit" ||
1712+ (i.labels .size () == 1 && i.labels .front () == " __VERIFIER_abort" )))
17121713 {
17131714 memory_leak_check (i.function );
17141715 }
Original file line number Diff line number Diff line change @@ -711,6 +711,7 @@ void goto_convertt::do_function_call_symbol(
711711 // are being checked
712712 goto_programt::targett a=dest.add_instruction (ASSUME);
713713 a->guard =false_exprt ();
714+ a->labels .push_back (" __VERIFIER_abort" );
714715 a->source_location =function.source_location ();
715716 a->source_location .set (" user-provided" , true );
716717 }
You can’t perform that action at this time.
0 commit comments