| ... | @@ -4800,12 +4800,8 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * | ... | @@ -4800,12 +4800,8 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * |
| 4800 | IrBasicBlock *else_block = ir_create_basic_block(irb, scope, "TryElse"); | 4800 | IrBasicBlock *else_block = ir_create_basic_block(irb, scope, "TryElse"); |
| 4801 | IrBasicBlock *endif_block = ir_create_basic_block(irb, scope, "TryEnd"); | 4801 | IrBasicBlock *endif_block = ir_create_basic_block(irb, scope, "TryEnd"); |
| 4802 | | 4802 | |
| 4803 | IrInstruction *is_comptime; | 4803 | bool force_comptime = ir_should_inline(irb->exec, scope); |
| 4804 | if (ir_should_inline(irb->exec, scope)) { | 4804 | IrInstruction *is_comptime = force_comptime ? ir_build_const_bool(irb, scope, node, true) : ir_build_test_comptime(irb, scope, node, is_err); |
| 4805 | is_comptime = ir_build_const_bool(irb, scope, node, true); | | |
| 4806 | } else { | | |
| 4807 | is_comptime = ir_build_test_comptime(irb, scope, node, is_err); | | |
| 4808 | } | | |
| 4809 | ir_build_cond_br(irb, scope, node, is_err, else_block, ok_block, is_comptime); | 4805 | ir_build_cond_br(irb, scope, node, is_err, else_block, ok_block, is_comptime); |
| 4810 | | 4806 | |
| 4811 | ir_set_cursor_at_end_and_append_block(irb, ok_block); | 4807 | ir_set_cursor_at_end_and_append_block(irb, ok_block); |
| ... | @@ -4814,8 +4810,9 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * | ... | @@ -4814,8 +4810,9 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * |
| 4814 | if (var_symbol) { | 4810 | if (var_symbol) { |
| 4815 | IrInstruction *var_type = nullptr; | 4811 | IrInstruction *var_type = nullptr; |
| 4816 | bool is_shadowable = false; | 4812 | bool is_shadowable = false; |
| | 4813 | IrInstruction *var_is_comptime = force_comptime ? ir_build_const_bool(irb, scope, node, true) : ir_build_test_comptime(irb, scope, node, err_val); |
| 4817 | VariableTableEntry *var = ir_create_var(irb, node, scope, | 4814 | VariableTableEntry *var = ir_create_var(irb, node, scope, |
| 4818 | var_symbol, var_is_const, var_is_const, is_shadowable, is_comptime); | 4815 | var_symbol, var_is_const, var_is_const, is_shadowable, var_is_comptime); |
| 4819 | | 4816 | |
| 4820 | IrInstruction *var_ptr_value = ir_build_unwrap_err_payload(irb, scope, node, err_val_ptr, false); | 4817 | IrInstruction *var_ptr_value = ir_build_unwrap_err_payload(irb, scope, node, err_val_ptr, false); |
| 4821 | IrInstruction *var_value = var_is_ptr ? var_ptr_value : ir_build_load_ptr(irb, scope, node, var_ptr_value); | 4818 | IrInstruction *var_value = var_is_ptr ? var_ptr_value : ir_build_load_ptr(irb, scope, node, var_ptr_value); |