forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit traps for unreachable nodes (JuliaLang#41465)
Raw `unreachable` in LLVM is somewhat dangerous since LLVM will literally stop emitting code there, so if the unreachable is wrong, execution will crash into whatever subsequent code exists, causing strange and mysterious errors and incorrect backtraces that are hard to debug without rr. As a result, we basically always emit a safety trap call before an `unreachable` terminator, which will abort execution at the point where unreachable was executed and at least provide proper backtraces. However, we neglected to do this for literal unreachables that came from Julia IR (i.e. ReturnNodes with undef val field). Fix that to make debugging easier if unreachable ever gets accidentally executed.
- Loading branch information
Showing
1 changed file
with
14 additions
and
9 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