-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc: Don't make the while loop body's basic block a child of the co…
…ndition As a child of the condition, when the body encounters a ret or break it incorrectly re-runs the cleanups of the condition.
- Loading branch information
Showing
2 changed files
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Issue 1974 | ||
// Don't double free the condition allocation | ||
fn main() { | ||
let s = "hej"; | ||
while s != "" { | ||
ret; | ||
} | ||
} |