Skip to content

Instantly share code, notes, and snippets.

@nikic

nikic/bug73900.diff Secret

Created Mar 30, 2017
Embed
What would you like to do?
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 4511859..e41736d 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1635,16 +1635,9 @@ fetch_from_array:
zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name));
} else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) {
if (!Z_ISREF_P(retval)) {
- if (Z_REFCOUNTED_P(retval) &&
- Z_REFCOUNT_P(retval) > 1) {
- if (Z_TYPE_P(retval) != IS_OBJECT) {
- Z_DELREF_P(retval);
- ZVAL_DUP(result, retval);
- retval = result;
- } else {
- ZVAL_COPY_VALUE(result, retval);
- retval = result;
- }
+ if (result != retval) {
+ ZVAL_COPY(result, retval);
+ retval = result;
}
if (Z_TYPE_P(retval) != IS_OBJECT) {
zend_class_entry *ce = Z_OBJCE_P(container);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.