Incorrect simulation when indexing into array using out-of-bounds bitvector #1807
Labels
subsystem: saw-core
Issues related to the saw-core representation or the saw-core subsystem
type: bug
Issues reporting bugs or unexpected/unwanted behavior
unsoundness
Issues that can lead to unsoundness or false verification
Milestone
Given this C code:
And this SAW specification:
Proving this with SAW with succeed, as expected:
Now what happens if you change the call to
get_spec 100 99
to something that performs an out-of-bounds index? If you change it toget_spec 100 100
:Then you will get an
index out of bounds
error during simulation, which is also expected:Now let's make one last change. Let's change
{{x @ (`pos)}}
(which indexes into thex
array using an integer) to{{x @ (`pos : [8])}}
(which indexes into thex
array using a bitvector):This shouldn't change much, but surprisingly, this causes the prove to succeed (erroneously!):
Digging into this a bit, the culprit is
saw-core
'sselectV
function. I will submit a patch shortly.The text was updated successfully, but these errors were encountered: