Compiler generates invalid LLVM IR for if/else with constant function in then branch #338
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq#338
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Seq 3.0.2 generates invalid LLVM IR when an if/else statement has a simple constant-returning function call as the only expression in the then branch. The generated IR is missing a terminator instruction (branch) before the else label.
Minimal Reproduction
Error
Generated LLVM IR (around the error)
The
if_thenblock ends with a call toseq_edit_done_to_i()but has no terminator (branch instruction) before theif_elselabel:Expected Behavior
The compiler should generate a branch instruction after the call to return/exit the if block before the else label.
Environment
https://github.com/navicore/patch-seq/pull/339