fixed a compiler bug in handling 'and' and 'or' - it didn't emit POP_STACKTOP after JUMP_FORWARD_IF_XXX.

improved some methods in some collection classes
This commit is contained in:
hyunghwan.chung
2018-06-24 16:47:55 +00:00
parent da33ecc167
commit c25bf15b21
2 changed files with 115 additions and 39 deletions

View File

@ -5549,7 +5549,8 @@ start_over:
bcode = (TOKEN_TYPE(moo) == MOO_IOTOK_AND)? BCODE_JUMP_FORWARD_IF_FALSE: BCODE_JUMP_FORWARD_IF_TRUE;
/* TODO: optimization if the expression is a known constant that can be determined to be boolean */
if (add_to_oow_pool(moo, &jumptoend, moo->c->mth.code.len) <= -1 ||
emit_single_param_instruction(moo, bcode, MAX_CODE_JUMP) <= -1) goto oops;
emit_single_param_instruction(moo, bcode, MAX_CODE_JUMP) <= -1 ||
emit_byte_instruction(moo, BCODE_POP_STACKTOP) <= -1) goto oops;
GET_TOKEN (moo);
/* compile_method_expression() calls this function with a non-null