diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-01-05 04:01:11 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-01-05 04:01:11 -0500 |
| commit | 438feebbcf687db47ff4a4be71a67b8587b2d987 (patch) | |
| tree | 647d9bc44f065edab158d4b1dcf8b8f724b0d5de /src | |
| parent | 3b5e26b7f7e4b37cf9357d058f32c0ad08ed7338 (diff) | |
| download | zig-438feebbcf687db47ff4a4be71a67b8587b2d987.tar.gz zig-438feebbcf687db47ff4a4be71a67b8587b2d987.zip | |
pass undeclared identifier test
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 75402595a6..6958cfc2e1 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); } |
