Skip to content

Commit beb5d76

Browse files
BUGFIX: Prefix operator code generator used a wrong operator to create the equivalent operations.
1 parent 2f10030 commit beb5d76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mvmCodegen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ void prefixOpCodegen(Ref<AstNode> statement, CodegenState* pState)
657657
//It is translated into a '+=' or '-=' equivalent operation
658658
Ref<AstLiteral> l = AstLiteral::create(op->position(), 1);
659659
Ref<AstNode> newOp = astCreateAssignment(op->position(),
660-
op->code == LEX_PLUSPLUS ? '+' : '-',
660+
op->code == LEX_PLUSPLUS ? LEX_PLUSEQUAL : LEX_MINUSEQUAL,
661661
op->children()[0],
662662
l);
663663
codegen(newOp, pState);

0 commit comments

Comments
 (0)