com php-src: Fixed refcount handling in get_class_vars( ): Zend/zend_builtin_functions.c
| From: | Xinchen Hui | Date: | Fri, 23 Jan 2015 05:32:07 +0000 |
| Subject: | com php-src: Fixed refcount handling in get_class_vars( ): Zend/zend_builtin_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84327@lists.php.net to get a copy of this message | ||
Commit: 16732dedfe84d16fa7ae11eff945672dc0214c7b
Author: Xinchen Hui <laruence@php.net> Fri, 23 Jan 2015 13:32:07 +0800
Parents: b8e262901e56a4d9a6664d348c9878246579239e
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=16732dedfe84d16fa7ae11eff945672dc0214c7b
Log:
Fixed refcount handling in get_class_vars()
Changed paths:
M Zend/zend_builtin_functions.c
Diff:
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions..c
index f5dd831..2fce4b7 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1058,6 +1058,8 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval
*return_value
if (UNEXPECTED(Z_COPYABLE_P(prop))) {
ZVAL_DUP(&prop_copy, prop);
prop = &prop_copy;
+ } else {
+ Z_TRY_ADDREF_P(prop);
}
/* this is necessary to make it able to work with default array