diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-07-04 09:35:12 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-07-04 09:35:12 +0300 |
commit | d84ef967424343abcc48b8f945d5e7807f1c1e09 (patch) | |
tree | afba43fcc652f2517812bdb3b1e86acac37b0621 /Zend | |
parent | a6467af8a5569d9953ee0ffae9565a746514de23 (diff) | |
download | php-git-d84ef967424343abcc48b8f945d5e7807f1c1e09.tar.gz |
SEND_UNPACK should throw exception on Traversable with non-integer keys
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_vm_def.h | 5 | ||||
-rw-r--r-- | Zend/zend_vm_execute.h | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 65b3f9faaf..095d947180 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4521,14 +4521,13 @@ ZEND_VM_C_LABEL(send_again): break; } - if (Z_TYPE(key) == IS_STRING) { + if (UNEXPECTED(Z_TYPE(key) != IS_LONG)) { + ZEND_ASSERT(Z_TYPE(key) == IS_STRING); zend_throw_error(NULL, "Cannot unpack Traversable with string keys"); zend_string_release_ex(Z_STR(key), 0); break; } - - zval_dtor(&key); } if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index c8e198b0b6..8220a021c2 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1358,14 +1358,13 @@ send_again: break; } - if (Z_TYPE(key) == IS_STRING) { + if (UNEXPECTED(Z_TYPE(key) != IS_LONG)) { + ZEND_ASSERT(Z_TYPE(key) == IS_STRING); zend_throw_error(NULL, "Cannot unpack Traversable with string keys"); zend_string_release_ex(Z_STR(key), 0); break; } - - zval_dtor(&key); } if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) { |