ir: fix vector negation using the nil value

We cannot use OFS_NULL as it is only a single value and
overlaps with OFS_RETURN.
This commit is contained in:
Wolfgang Bumiller 2017-06-22 08:46:48 +02:00
parent e160c9ed7a
commit c2d05150a9

2
ir.c
View file

@ -1892,7 +1892,7 @@ ir_value* ir_block_create_unary(ir_block *self, lex_ctx_t ctx,
case VINSTR_NEG_F: case VINSTR_NEG_F:
return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_F, NULL, operand, ot); return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_F, NULL, operand, ot);
case VINSTR_NEG_V: case VINSTR_NEG_V:
return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_V, NULL, operand, ot); return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_V, self->owner->owner->nil, operand, ot);
default: default:
ot = operand->vtype; ot = operand->vtype;