mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Codegen error in if (try x = (false ? io::EOF? : 1)), i.e. using if-try with a CT known value.
This commit is contained in:
@@ -4284,9 +4284,16 @@ void llvm_emit_try_assign_try_catch(GenContext *c, bool is_try, BEValue *be_valu
|
||||
return;
|
||||
}
|
||||
|
||||
if (llvm_basic_block_is_unused(catch_block))
|
||||
{
|
||||
llvm_value_set(be_value, LLVMConstInt(c->bool_type, is_try ? 1 : 0, false), type_bool);
|
||||
return;
|
||||
}
|
||||
|
||||
// 10. Jump to the phi
|
||||
llvm_emit_br(c, phi_catch);
|
||||
|
||||
|
||||
// 11. Emit the catch and jump.
|
||||
llvm_emit_block(c, catch_block);
|
||||
llvm_emit_br(c, phi_catch);
|
||||
|
||||
Reference in New Issue
Block a user