Created
August 17, 2015 15:58
-
-
Save m6w6/d51e7ef822cb8082c0ed to your computer and use it in GitHub Desktop.
Fix inheritance of internal interafce's constants
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c | |
index 77ea7d5..3ccade9 100644 | |
--- a/Zend/zend_inheritance.c | |
+++ b/Zend/zend_inheritance.c | |
@@ -917,7 +917,13 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zva | |
static void do_inherit_iface_constant(zend_string *name, zval *zv, zend_class_entry *ce, zend_class_entry *iface) /* {{{ */ | |
{ | |
if (do_inherit_constant_check(&ce->constants_table, zv, name, iface)) { | |
- ZVAL_MAKE_REF(zv); | |
+ if (!Z_ISREF_P(zv)) { | |
+ if (iface->type == ZEND_INTERNAL_CLASS) { | |
+ ZVAL_NEW_PERSISTENT_REF(zv, zv); | |
+ } else { | |
+ ZVAL_NEW_REF(zv, zv); | |
+ } | |
+ } | |
Z_ADDREF_P(zv); | |
if (Z_CONSTANT_P(Z_REFVAL_P(zv))) { | |
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment