authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-11-27 01:31:09-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-11-27 01:31:09-05:00
loge5325c7ef3c5b0fe9afbcba59cd269608d65dda0
tree31de00fbdf19690efff218b55ac79d0adc30c571
parentd9329ed389e4454c631772674beee459c7783069

IR: fix not checking for error in unary bool not


1 files changed, 6 insertions(+), 2 deletions(-)

src/ir.cpp+6-2
...@@ -4012,10 +4012,14 @@ static TypeTableEntry *ir_analyze_instruction_call(IrAnalyze *ira, IrInstruction...@@ -4012,10 +4012,14 @@ static TypeTableEntry *ir_analyze_instruction_call(IrAnalyze *ira, IrInstruction
4012}4012}
40134013
4014static TypeTableEntry *ir_analyze_unary_bool_not(IrAnalyze *ira, IrInstructionUnOp *un_op_instruction) {4014static TypeTableEntry *ir_analyze_unary_bool_not(IrAnalyze *ira, IrInstructionUnOp *un_op_instruction) {
4015 IrInstruction *value = un_op_instruction->value->other;
4016 if (value->type_entry->id == TypeTableEntryIdInvalid)
4017 return ira->codegen->builtin_types.entry_invalid;
4018
4015 TypeTableEntry *bool_type = ira->codegen->builtin_types.entry_bool;4019 TypeTableEntry *bool_type = ira->codegen->builtin_types.entry_bool;
40164020
4017 IrInstruction *casted_value = ir_get_casted_value(ira, un_op_instruction->value->other, bool_type);4021 IrInstruction *casted_value = ir_get_casted_value(ira, value, bool_type);
4018 if (casted_value == ira->codegen->invalid_instruction)4022 if (casted_value->type_entry->id == TypeTableEntryIdInvalid)
4019 return ira->codegen->builtin_types.entry_invalid;4023 return ira->codegen->builtin_types.entry_invalid;
40204024
4021 ConstExprValue *operand_val = &casted_value->static_value;4025 ConstExprValue *operand_val = &casted_value->static_value;