Skip to content

Commit c266846

Browse files
committed
Pretty print havoc_object instructions
1 parent 4dc2dd5 commit c266846

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
int main()
2+
{
3+
int a[64];
4+
__CPROVER_havoc_object(a);
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--show-goto-functions
4+
HAVOC_OBJECT \(void \*\)a
5+
^SIGNAL=0$
6+
^EXIT=0$
7+
--
8+
irep\("\(.* \(\\"havoc_object\\"\)\)"\)

src/goto-programs/goto_program.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,20 @@ std::ostream &goto_programt::output_instruction(
100100
out << '\n';
101101
break;
102102

103-
case RETURN:
104103
case OTHER:
104+
if(instruction.get_other().id() == ID_code)
105+
{
106+
const auto &code = to_code(instruction.get_other());
107+
if(code.get_statement() == ID_havoc_object)
108+
{
109+
out << "HAVOC_OBJECT " << from_expr(ns, identifier, code.op0()) << '\n';
110+
break;
111+
}
112+
// fallthrough
113+
}
114+
// fallthrough
115+
116+
case RETURN:
105117
case DECL:
106118
case DEAD:
107119
case FUNCTION_CALL:

0 commit comments

Comments
 (0)