Segfault using ternary with no assignment #1468.

This commit is contained in:
Christoffer Lerno
2024-09-21 00:57:36 +02:00
parent 2a9078a3b4
commit d727696830
3 changed files with 37 additions and 0 deletions

View File

@@ -4969,6 +4969,11 @@ void gencontext_emit_ternary_expr(GenContext *c, BEValue *value, Expr *expr)
return;
}
if (expr->type == type_void)
{
llvm_value_set(value, NULL, expr->type);
return;
}
llvm_new_phi(c, value, "val", expr->type, lhs_value, lhs_exit, rhs_value, rhs_exit);
}
static LLVMValueRef llvm_emit_real(LLVMTypeRef type, Float f)