summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-07-06 03:11:20 +0300
committerDmitry Stogov <dmitry@zend.com>2018-07-06 03:11:20 +0300
commit41db5f73ce452f4135c61419b6535245dd1e724c (patch)
tree7faeec4a102139a71ab173cc41be06494b1d9a72 /Zend
parentdcf7592076277be611f20cccf7865a66e62d1a5f (diff)
downloadphp-git-41db5f73ce452f4135c61419b6535245dd1e724c.tar.gz
Fixed reference-counting in zend_parse_arg_str_weak()
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_API.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index f1f6a75e50..daa938a302 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -531,12 +531,13 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest
zval rv;
zval *z = Z_OBJ_HANDLER_P(arg, get)(arg, &rv);
- Z_ADDREF_P(z);
if (Z_TYPE_P(z) != IS_OBJECT) {
- zval_dtor(arg);
- ZVAL_NULL(arg);
- if (!zend_make_printable_zval(z, arg)) {
+ zval_ptr_dtor(arg);
+ if (Z_TYPE_P(z) == IS_STRING) {
ZVAL_COPY_VALUE(arg, z);
+ } else {
+ ZVAL_STR(arg, zval_get_string_func(z));
+ zval_ptr_dtor(z);
}
*dest = Z_STR_P(arg);
return 1;