Skip to content

Commit b623a0b

Browse files
committed
Improve comments to explain containment check
Signed-off-by: Felipe R. Monteiro <[email protected]>
1 parent 078b659 commit b623a0b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/goto-instrument/contracts/assigns.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ exprt assigns_clauset::targett::generate_containment_check(
5656
// If assigns target was a dereference, comparing objects is enough
5757
if(id == ID_dereference)
5858
{
59+
// __CPROVER_w_ok(target, sizeof(target)) &&
60+
// __CPROVER_same_object(lhs, target)
5961
return conjunction(condition);
6062
}
6163

@@ -81,6 +83,11 @@ exprt assigns_clauset::targett::generate_containment_check(
8183
// (sizeof(target) + __CPROVER_offset(target))
8284
condition.push_back(binary_relation_exprt(lhs_region, ID_le, own_region));
8385

86+
// __CPROVER_w_ok(target, sizeof(target)) &&
87+
// __CPROVER_same_object(lhs, target) &&
88+
// __CPROVER_offset(lhs) >= __CPROVER_offset(target) &&
89+
// (sizeof(lhs) + __CPROVER_offset(lhs)) <=
90+
// (sizeof(target) + __CPROVER_offset(target))
8491
return conjunction(condition);
8592
}
8693

0 commit comments

Comments
 (0)