summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-08-13 12:36:10 +0400
committerDmitry Stogov <dmitry@zend.com>2014-08-13 12:36:10 +0400
commitb8517e410ce4209d05f911d35d9ec77a2cc191c9 (patch)
tree91cb1fd18cd2d7250e08d6f6408d4aa569163893
parentda3aeeed39f24e34e9318d7123ff84f0c5a98e61 (diff)
downloadphp-git-b8517e410ce4209d05f911d35d9ec77a2cc191c9.tar.gz
cleanup
-rw-r--r--ext/reflection/php_reflection.c20
-rw-r--r--main/network.c2
2 files changed, 5 insertions, 17 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index fd7569bcb8..4248de834d 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1799,8 +1799,7 @@ ZEND_METHOD(reflection_function, getFileName)
}
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION) {
-// TODO: we have to duplicate it, becaise it may be in opcache SHM ???
- RETURN_STR(STR_DUP(fptr->op_array.filename, 0));
+ RETURN_STR(STR_COPY(fptr->op_array.filename));
}
RETURN_FALSE;
}
@@ -1854,8 +1853,7 @@ ZEND_METHOD(reflection_function, getDocComment)
}
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) {
-// TODO: we have to duplicate it, becaise it may be stored in opcache SHM ???
- RETURN_STR(STR_DUP(fptr->op_array.doc_comment, 0));
+ RETURN_STR(STR_COPY(fptr->op_array.doc_comment));
}
RETURN_FALSE;
}
@@ -3451,8 +3449,6 @@ ZEND_METHOD(reflection_class, setStaticPropertyValue)
zend_class_entry *ce;
zend_string *name;
zval *variable_ptr, *value;
-//??? int refcount;
-//??? zend_uchar is_ref;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &name, &value) == FAILURE) {
return;
@@ -3467,13 +3463,8 @@ ZEND_METHOD(reflection_class, setStaticPropertyValue)
"Class %s does not have a property named %s", ce->name->val, name->val);
return;
}
-//??? refcount = Z_REFCOUNT_PP(variable_ptr);
-//??? is_ref = Z_ISREF_PP(variable_ptr);
- zval_dtor(variable_ptr);
- ZVAL_DUP(variable_ptr, value);
-//??? Z_SET_REFCOUNT_PP(variable_ptr, refcount);
-//??? Z_SET_ISREF_TO_PP(variable_ptr, is_ref);
-
+ zval_ptr_dtor(variable_ptr);
+ ZVAL_COPY(variable_ptr, value);
}
/* }}} */
@@ -3566,8 +3557,7 @@ ZEND_METHOD(reflection_class, getFileName)
}
GET_REFLECTION_OBJECT_PTR(ce);
if (ce->type == ZEND_USER_CLASS) {
-// TODO: we have to duplicate it, becaise it may be stored in opcache SHM ???
- RETURN_STR(STR_DUP(ce->info.user.filename, 0));
+ RETURN_STR(STR_COPY(ce->info.user.filename));
}
RETURN_FALSE;
}
diff --git a/main/network.c b/main/network.c
index ce88bf41ea..d2bc35b4fb 100644
--- a/main/network.c
+++ b/main/network.c
@@ -563,7 +563,6 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, long ad
if (n == 0) {
if (errstr) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to resolve `%s': %s", tmp, errstr);
-//??? STR_FREE(errstr);
efree(errstr);
}
goto out;
@@ -590,7 +589,6 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, long ad
php_network_freeaddresses(psal);
out:
-//??? STR_FREE(tmp);
efree(tmp);
return ret;
}