Closed
Description
Some examples that cause rustc to overflow its stack:
assert_eq!(i64::max_value() % 2, 1);
assert_eq!(i64::min_value() % 2, 0);
Give error message at compile time:
thread 'rustc' has overflowed its stack
Gives a stack overflow too if you use i8
,i16
,i32
, but it can't be reproduced with unsigned types.
Also, this doesn't reproduce the stack overflow either:
let m = i64::min_value();
assert_eq!(m % 2, 0);
This dates back to at least rustc 1.12 stable, and is reproducible with recent nightly as well.
Metadata
Metadata
Assignees
Labels
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.High priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.