Skip to content

Commit 20d0bed

Browse files
committed
Add support for property "Memory Cleanup"
1 parent ff9a66e commit 20d0bed

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tool-wrapper.inc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ OPTIONS["unreach_call"]=""
1010
OPTIONS["termination"]=""
1111
OPTIONS["overflow"]="--signed-overflow-check --no-assertions"
1212
OPTIONS["memsafety"]="--pointer-check --memory-leak-check --bounds-check --no-assertions"
13+
OPTIONS["memcleanup"]="--pointer-check --memory-leak-check --bounds-check --no-assertions"
1314

1415
parse_property_file()
1516
{
@@ -22,6 +23,7 @@ if(/^CHECK\(init\((\S+)\(\)\),LTL\((\S+)\)\)$/) {
2223
print "PROP=\"unreach_call\"\n" if($2 =~ /^G!call\(__VERIFIER_error\(\)\)$/);
2324
print "PROP=\"unreach_call\"\n" if($2 =~ /^Gassert$/);
2425
print "PROP=\"memsafety\"\n" if($2 =~ /^Gvalid-(free|deref|memtrack)$/);
26+
print "PROP=\"memcleanup\"\n" if($2 =~ /^Gvalid-(free|deref|memtrack)$/);
2527
print "PROP=\"overflow\"\n" if($2 =~ /^G!overflow$/);
2628
print "PROP=\"termination\"\n" if($2 =~ /^Fend$/);
2729
}'
@@ -31,10 +33,18 @@ parse_result()
3133
{
3234
if tail -n 50 $LOG.ok | \
3335
grep -Eq "^(\[.*\] .*__CPROVER_memory_leak == NULL|[[:space:]]*__CPROVER_memory_leak == NULL$)" ; then
34-
echo 'FALSE(valid-memtrack)'
36+
if [[ "$PROP" == "memcleanup" ]]; then
37+
echo 'FALSE(valid-memcleanup)'
38+
else
39+
echo 'FALSE(valid-memtrack)'
40+
fi
3541
elif tail -n 50 $LOG.ok | \
3642
grep -Eq "^(\[.*\] |[[:space:]]*)dynamically allocated memory never freed in " ; then
37-
echo 'FALSE(valid-memtrack)'
43+
if [[ "$PROP" == "memcleanup" ]]; then
44+
echo 'FALSE(valid-memcleanup)'
45+
else
46+
echo 'FALSE(valid-memtrack)'
47+
fi
3848
elif tail -n 50 $LOG.ok | \
3949
grep -Eq "^(\[.*\] |[[:space:]]*)dereference failure:" ; then
4050
echo 'FALSE(valid-deref)'

0 commit comments

Comments
 (0)