Skip to content

Commit 2e15fb4

Browse files
committed
Full slice: support havoc_object
Value sets should at least accept this statement exists, and goto_rw needs to ensure that it knows about the write side-effect of it.
1 parent 31f1b59 commit 2e15fb4

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--full-slice
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
^\*\* 6 of 8 failed.*$
8+
--

src/analyses/goto_rw.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,14 @@ static void goto_rw_other(
794794
rw_set.get_array_objects(
795795
function, target, rw_range_sett::get_modet::READ, code.op1());
796796
}
797+
else if(statement == ID_havoc_object)
798+
{
799+
PRECONDITION(code.operands().size() == 1);
800+
// re-use get_array_objects as this havoc_object affects whatever is the
801+
// object being the pointer that code.op0() is
802+
rw_set.get_array_objects(
803+
function, target, rw_range_sett::get_modet::LHS_W, code.op0());
804+
}
797805
}
798806

799807
static void goto_rw(

src/pointer-analysis/value_set.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,9 @@ void value_sett::apply_code_rec(
16721672
{
16731673
// Ignore by default; could prune the value set.
16741674
}
1675+
else if(statement == ID_havoc_object)
1676+
{
1677+
}
16751678
else
16761679
{
16771680
// std::cerr << code.pretty() << '\n';

src/pointer-analysis/value_set_fi.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,9 @@ void value_set_fit::apply_code(const codet &code, const namespacet &ns)
13991399
{
14001400
// doesn't do anything
14011401
}
1402+
else if(statement == ID_havoc_object)
1403+
{
1404+
}
14021405
else
14031406
throw
14041407
code.pretty()+"\n"+

0 commit comments

Comments
 (0)