fixed a bug of not skipping a goto struct with its ip set to INVALID_IP in adjust_all_gotos_for_elimination()

This commit is contained in:
hyunghwan.chung 2019-08-05 15:18:22 +00:00
parent ea69bb8d45
commit 5296cadde2

View File

@ -2864,6 +2864,8 @@ static MOO_INLINE void adjust_all_gotos_for_elimination (moo_t* moo, moo_oow_t s
_goto = cc->mth._goto; _goto = cc->mth._goto;
while (_goto) while (_goto)
{
if (_goto->ip != INVALID_IP)
{ {
if (_goto->ip >= start && _goto->ip <= end) if (_goto->ip >= start && _goto->ip <= end)
{ {
@ -2875,6 +2877,7 @@ static MOO_INLINE void adjust_all_gotos_for_elimination (moo_t* moo, moo_oow_t s
{ {
_goto->ip -= end - start + 1; _goto->ip -= end - start + 1;
} }
}
_goto = _goto->next; _goto = _goto->next;
} }
@ -5110,7 +5113,6 @@ moo_oow_t pop_stacktop_pos = INVALID_IP; /* TODO: move this up */
} }
else if (TOKEN_TYPE(moo) == MOO_IOTOK_PERIOD) else if (TOKEN_TYPE(moo) == MOO_IOTOK_PERIOD)
{ {
moo_ioloc_t period_loc = *TOKEN_LOC(moo);
GET_TOKEN (moo); GET_TOKEN (moo);
if (TOKEN_TYPE(moo) == MOO_IOTOK_RBRACK) if (TOKEN_TYPE(moo) == MOO_IOTOK_RBRACK)
{ {