summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-10-10 14:41:35 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-10-10 14:41:35 +0200
commit4463acb9513dfb62206760c49b3da1fe4d92f40a (patch)
tree8726b06b7cfb6c114b46e838d9e931217d5b90f8 /Zend
parent12f4e9e020c3968c5a201ef96c4ee589ad36e5e5 (diff)
downloadphp-git-4463acb9513dfb62206760c49b3da1fe4d92f40a.tar.gz
Explicitly check for exceptions in by-ref obj prop assign
Relying on setting ERROR if an exception happened during the property address fetch is both a bit fragile and may pessimize other codepaths that will check for exceptions in the VM. Adding an extra exception check instead, which should also allow us to drop the use of ERROR in this area in master.
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_execute.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index b69d0a88d5..368d6b2dcc 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -2858,7 +2858,7 @@ static zend_always_inline void zend_assign_to_property_reference(zval *container
variable_ptr = Z_INDIRECT_P(variable_ptr);
}
- if (UNEXPECTED(Z_ISERROR_P(variable_ptr))) {
+ if (UNEXPECTED(Z_ISERROR_P(variable_ptr) || EG(exception))) {
variable_ptr = &EG(uninitialized_zval);
} else if (UNEXPECTED(Z_TYPE(variable) != IS_INDIRECT)) {
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");