You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like decrementing the pointer with --pa just doesn't work, you can fix the code by doing pa -= 1; return *pa; if we wanted to keep the behavior modifying the pointer.
This is a subtle bug! The difference in the generated LLVM code is twofold:
The latter version stores the result of the pointer decrement, which I think is irrelevant.
The latter version uses a 32-bit -1 constant in the getelementptr instruction whereas the former uses a 64-bit -1 constant. We currently assume 64-bit addresses.
I expect that the 32-bit -1 isn't being sign-extended, so it gets treated as a large positive value instead of a negative value.
Suppose we have this somewhat nonsensical function:
And here's some SAW code to test it:
This yields
Successfully verified @test
. If you change the function to the following though you get a user error:The text was updated successfully, but these errors were encountered: