-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use abortExecBecause
in abort()
override
#789
Conversation
It looks like this has an impact on the |
As I've been updating the test suite output for #[inline(never)]
fn div_signed(x: i8, y: i8) -> i8 {
x / y
}
#[inline(never)]
fn div_unsigned(x: u8, y: u8) -> u8 {
x / y
}
#[cfg_attr(crux, crux_test)]
fn crux_test() -> u8 {
let a: i8 = div_signed(1, 1);
let b: i8 = div_signed(-128, -1); // Should fail
let c: i8 = div_signed(-128, -2);
let d: i8 = div_signed(-127, -1);
let e: i8 = div_signed(-1, 0); // Should fail
let f: u8 = div_unsigned(1, 1);
let g: u8 = div_unsigned(1, 0); // Should fail
(a + b + c + d + e) as u8 + (f + g)
}
pub fn main() {
println!("{:?}", crux_test());
} Before this patch, this would produce three counterexamples, one for each
After this patch, however, this only produces a single counterexample:
This isn't wrong, strictly speaking, but it does lose the nice property of reporting on all issues in the program at once. |
shrug I'm of the opinion that this is proper behavior, but I suppose others might disagree. My usual stance is that, once a fatal error has occurred, it doesn't make much sense to keep running the program. |
For some reason, the situation in #789 (comment) feels slightly different to me than in the original |
Well, even if we decide this isn't the way to fix this, we should ensure that |
This ensures that we do not enter `unreachable` code after simulating an invocation of `abort()`. Fixes #787.
I've pushed a more conservative fix which simply uses |
abortExecBecause
in abort()
override
We wish to abort on concretely false assertions even if
assertThenAssume
is set to false, as this prevents exploring blatantly unreachable code paths like theunreachable
instruction after a call toabort()
.Fixes #787.