Skip to content

Commit f845c9f

Browse files
lucasccordeiroDaniel Kroening
authored and
Daniel Kroening
committed
Add violation node for the memory safety benchmarks
We must not filter out generated assertions for memory leaks.
1 parent ba964e7 commit f845c9f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/goto-programs/graphml_witness.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Author: Daniel Kroening
1111

1212
#include "graphml_witness.h"
1313

14+
#include <util/arith_tools.h>
1415
#include <util/byte_operators.h>
1516
#include <util/c_types.h>
16-
#include <util/arith_tools.h>
17+
#include <util/cprover_prefix.h>
1718
#include <util/prefix.h>
1819
#include <util/ssa_expr.h>
1920

@@ -189,7 +190,14 @@ static bool filter_out(
189190
source_location.get_file().empty() ||
190191
source_location.is_built_in() ||
191192
source_location.get_line().empty())
192-
return true;
193+
{
194+
const irep_idt id = source_location.get_function();
195+
// Do not filter out assertions in functions the name of which starts with
196+
// CPROVER_PREFIX, because we need to maintain those as violation nodes:
197+
// these are assertions generated, for examples, for memory leaks.
198+
if(!has_prefix(id2string(id), CPROVER_PREFIX) || !it->is_assert())
199+
return true;
200+
}
193201

194202
return false;
195203
}

0 commit comments

Comments
 (0)