diff options
Diffstat (limited to 'Zend/zend_inheritance.c')
| -rw-r--r-- | Zend/zend_inheritance.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index c200573ac8..98a3ae6459 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -775,6 +775,11 @@ static void do_inherit_class_constant(zend_string *name, zend_class_constant *pa if (Z_TYPE(parent_const->value) == IS_CONSTANT_AST) { ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; } + if (ce->type & ZEND_INTERNAL_CLASS) { + c = pemalloc(sizeof(zend_class_constant), 1); + memcpy(c, parent_const, sizeof(zend_class_constant)); + parent_const = c; + } _zend_hash_append_ptr(&ce->constants_table, name, parent_const); } } @@ -1003,6 +1008,11 @@ static void do_inherit_iface_constant(zend_string *name, zend_class_constant *c, if (Z_TYPE(c->value) == IS_CONSTANT_AST) { ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; } + if (ce->type & ZEND_INTERNAL_CLASS) { + ct = pemalloc(sizeof(zend_class_constant), 1); + memcpy(ct, c, sizeof(zend_class_constant)); + c = ct; + } zend_hash_update_ptr(&ce->constants_table, name, c); } } |
