com php-src: fix inheritance of internal interfaces with constants: Zend/zend_inheritance.c

From: Date: Tue, 18 Aug 2015 06:20:12 +0000
Subject: com php-src: fix inheritance of internal interfaces with constants: Zend/zend_inheritance.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-88574@lists.php.net to get a copy of this message
Commit: 17fc5cc65d3e7426516421f8bc950a97e1945f2f Author: Michael Wallner <mike@php.net> Tue, 18 Aug 2015 08:19:59 +0200 Parents: e6e5defb3189b3f4a8f7635143bbae0d710a78dc Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=17fc5cc65d3e7426516421f8bc950a97e1945f2f Log: fix inheritance of internal interfaces with constants Changed paths: M Zend/zend_inheritance.c Diff: 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;

« previous php.cvs (#88574) next »