CBC_PUSH_THIS_LITERAL must be converted back to CBC_PUSH_THIS during emitting unary lvalue opcode (#2939)

This patch fixes #2937.

Co-authored-by: Gabor Loki loki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-07-04 18:26:46 +02:00
committed by Dániel Bátyai
parent d22f6b451b
commit 8766bb3b37
2 changed files with 38 additions and 0 deletions
+8
View File
@@ -164,6 +164,14 @@ parser_emit_unary_lvalue_opcode (parser_context_t *context_p, /**< context */
JERRY_ASSERT (CBC_SAME_ARGS (CBC_PUSH_PROP, opcode));
context_p->last_cbc_opcode = (uint16_t) opcode;
}
else if (context_p->last_cbc_opcode == CBC_PUSH_THIS_LITERAL
&& context_p->last_cbc.literal_type == LEXER_IDENT_LITERAL)
{
context_p->last_cbc_opcode = CBC_PUSH_THIS;
parser_emit_cbc_literal (context_p,
(uint16_t) (opcode + CBC_UNARY_LVALUE_WITH_IDENT),
context_p->lit_object.index);
}
else
{
switch (context_p->last_cbc_opcode)