From 438feebbcf687db47ff4a4be71a67b8587b2d987 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 5 Jan 2017 04:01:11 -0500 Subject: [PATCH] pass undeclared identifier test --- src/ir.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ir.cpp b/src/ir.cpp index 75402595a60d2c654cc853ff8f1119071bfa88dc..6958cfc2e14b9c516522fa41a5ed2c847348d9f6 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -3096,12 +3096,10 @@ static IrInstruction *ir_gen_block(IrBuilder *irb, Scope *parent_scope, AstNode static IrInstruction *ir_gen_bin_op_id(IrBuilder *irb, Scope *scope, AstNode *node, IrBinOp op_id) { IrInstruction *op1 = ir_gen_node(irb, node->data.bin_op_expr.op1, scope); - if (op1 == irb->codegen->invalid_instruction) - return op1; - IrInstruction *op2 = ir_gen_node(irb, node->data.bin_op_expr.op2, scope); - if (op2 == irb->codegen->invalid_instruction) - return op2; + + if (op1 == irb->codegen->invalid_instruction || op2 == irb->codegen->invalid_instruction) + return irb->codegen->invalid_instruction; return ir_build_bin_op(irb, scope, node, op_id, op1, op2, true); } -- 2.54.0