rust/src/test/run-pass/issue-1974.rs
Brian Anderson aeb445b2ea rustc: Don't make the while loop body's basic block a child of the condition
As a child of the condition, when the body encounters a ret or break it
incorrectly re-runs the cleanups of the condition.
2012-03-13 17:27:17 -07:00

8 lines
131 B
Rust

// Issue 1974
// Don't double free the condition allocation
fn main() {
let s = "hej";
while s != "" {
ret;
}
}