Skip to content

Commit 09b87ec

Browse files
committed
Use correct type for pointer checks in contracts
1 parent f5f965a commit 09b87ec

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--replace-all-calls-with-contracts
44
^EXIT=0$
@@ -7,7 +7,3 @@ main.c
77
--
88
--
99
This test checks that a havocked variable can be constrained by a function post-condition.
10-
11-
Known Bug:
12-
Currently, there is a bug when char variables are being passed to
13-
__CPROVER_w_ok(). See GitHub issue #6106 for further details.

src/goto-instrument/code_contracts.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,7 @@ goto_programt assigns_clauset::havoc_code(
16981698
{
16991699
// create the condition
17001700
exprt condition =
1701-
not_exprt(w_ok_exprt(target_ptr, from_integer(0, integer_typet())));
1701+
not_exprt(w_ok_exprt(target_ptr, from_integer(0, unsigned_int_type())));
17021702
havoc_statements.add(goto_programt::make_goto(z, condition, location));
17031703
}
17041704

@@ -1776,7 +1776,7 @@ exprt assigns_clauset::compatible_expression(
17761776
// checked on invalid called_targets.
17771777
current_target_compatible = or_exprt(
17781778
not_exprt(
1779-
w_ok_exprt(called_target_ptr, from_integer(0, integer_typet()))),
1779+
w_ok_exprt(called_target_ptr, from_integer(0, unsigned_int_type()))),
17801780
target->compatible_expression(*called_target));
17811781
}
17821782
else

0 commit comments

Comments
 (0)