Commit 4674660
Fix check_count_bytes harness: use kani::assume instead of array mutation
The original harness mutated a symbolic array at a symbolic index
(bytes[len] = 0), which CBMC's array-store model doesn't reliably
propagate when the array and index are both fully symbolic. This caused
from_bytes_until_nul(...).unwrap() to fail spuriously.
Rewrite using kani::assume to directly constrain the symbolic space:
assume bytes[len] == 0 and bytes[i] != 0 for i < len. This is
semantically equivalent but avoids the problematic symbolic store.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b2bc80d commit 4674660
1 file changed
Lines changed: 16 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
1004 | | - | |
| 1004 | + | |
1005 | 1005 | | |
1006 | 1006 | | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
1019 | 1021 | | |
1020 | 1022 | | |
1021 | 1023 | | |
1022 | | - | |
| 1024 | + | |
1023 | 1025 | | |
1024 | 1026 | | |
1025 | 1027 | | |
| |||
0 commit comments