-
Notifications
You must be signed in to change notification settings - Fork 3
Missing terminator inside if-else branch #95
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
The following program generates invalid LLVM IR because a terminator is not emitted to jump out of the if-branch.
extern puts(cstr_t) -> i32_t;
func maybe_print_hello(bool_t x) mutable -> i32_t
{
if (x)
puts("hello");
return 0;
}The IR generated currently is something like
declare signext i32 @puts(i8* nonnull)
define signext i32 @maybe_print_hello(i1 zeroext %x) {
entry:
br i1 %x, label %then, label %else
then:
%0 = call i32 @puts(...)
else:
br label %next
next:
ret i32 0
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working