diff options
Diffstat (limited to 'Zend/zend_vm_execute.h')
-rw-r--r-- | Zend/zend_vm_execute.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 0768aa6df2..5d448c34d4 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -3222,6 +3222,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A ptr->pos = pos; ptr->ht = fe_ht; ptr->h = fe_ht->arData[pos].h; + ptr->key = fe_ht->arData[pos].key; is_empty = 0; } else { zend_error(E_WARNING, "Invalid argument supplied for foreach()"); @@ -10032,6 +10033,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG ptr->pos = pos; ptr->ht = fe_ht; ptr->h = fe_ht->arData[pos].h; + ptr->key = fe_ht->arData[pos].key; is_empty = 0; } else { zend_error(E_WARNING, "Invalid argument supplied for foreach()"); @@ -16747,6 +16749,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG ptr->pos = pos; ptr->ht = fe_ht; ptr->h = fe_ht->arData[pos].h; + ptr->key = fe_ht->arData[pos].key; is_empty = 0; } else { zend_error(E_WARNING, "Invalid argument supplied for foreach()"); @@ -16801,8 +16804,11 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG pos = ptr->h; } else { pos = fe_ht->arHash[ptr->h & fe_ht->nTableMask]; - while (pos != INVALID_IDX) { - if (fe_ht->arData[pos].h == ptr->h && pos == ptr->pos) { + while (1) { + if (pos == INVALID_IDX) { + pos = fe_ht->nInternalPointer; + break; + } else if (fe_ht->arData[pos].h == ptr->h && fe_ht->arData[pos].key == ptr->key) { break; } pos = Z_NEXT(fe_ht->arData[pos].val); @@ -16855,6 +16861,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)); fe_ht->nInternalPointer = ptr->pos = pos; ptr->h = fe_ht->arData[pos].h; + ptr->key = fe_ht->arData[pos].key; ZEND_VM_INC_OPCODE(); ZEND_VM_NEXT_OPCODE(); } else if (EXPECTED(Z_TYPE_P(array) == IS_OBJECT)) { @@ -16878,8 +16885,11 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG pos = ptr->h; } else { pos = fe_ht->arHash[ptr->h & fe_ht->nTableMask]; - while (pos != INVALID_IDX) { - if (fe_ht->arData[pos].h == ptr->h && pos == ptr->pos) { + while (1) { + if (pos == INVALID_IDX) { + pos = fe_ht->nInternalPointer; + break; + } else if (fe_ht->arData[pos].h == ptr->h && fe_ht->arData[pos].key == ptr->key) { break; } pos = Z_NEXT(fe_ht->arData[pos].val); @@ -16948,6 +16958,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_check_property_access(zobj, p->key TSRMLS_CC) == FAILURE)); fe_ht->nInternalPointer = ptr->pos = pos; ptr->h = fe_ht->arData[pos].h; + ptr->key = fe_ht->arData[pos].key; ZEND_VM_INC_OPCODE(); ZEND_VM_NEXT_OPCODE(); } else { @@ -34388,6 +34399,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS ptr->pos = pos; ptr->ht = fe_ht; ptr->h = fe_ht->arData[pos].h; + ptr->key = fe_ht->arData[pos].key; is_empty = 0; } else { zend_error(E_WARNING, "Invalid argument supplied for foreach()"); |