Skip to content

Commit a0223a8

Browse files
authored
Avoid spurious arithmetic overflow in CBMC proofs (#130)
* Avoid spurious arithmetic overflow in CBMC proofs * Ignore macOS artifacts * Ignore IDE artifacts Signed-off-by: Felipe R. Monteiro <[email protected]>
1 parent 66a18ba commit a0223a8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ build/
1111
*.gcda
1212
*.gcno
1313
*.gcov
14+
15+
# Ignore macOS artifacts
16+
.DS_Store
17+
18+
# Ignore IDE artifacts
19+
.vscode/

test/cbmc/stubs/skipGeneric.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ static bool skipGeneric( const char * buf,
4141

4242
if( *start < max )
4343
{
44-
assert( __CPROVER_r_ok( ( buf + *start ), ( max - *start ) ) );
44+
size_t readable_length = max - *start;
45+
assert( __CPROVER_r_ok( ( buf + *start ), readable_length ) );
4546

4647
if( nondet_bool() && ( min <= max ) )
4748
{

0 commit comments

Comments
 (0)