summaryrefslogtreecommitdiff
path: root/Zend/zend_constants.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-04-22 17:46:34 +0400
committerDmitry Stogov <dmitry@zend.com>2014-04-22 17:46:34 +0400
commit5864ce8a447b718d0912cb073afe87eddc47b2e8 (patch)
tree81d7b40143c084383637c253bd61c3c795ca428f /Zend/zend_constants.c
parentc0b49a701a74f9be1f99f79c4334d4aecdf1f1c6 (diff)
downloadphp-git-5864ce8a447b718d0912cb073afe87eddc47b2e8.tar.gz
Fixed compilation warnings
Diffstat (limited to 'Zend/zend_constants.c')
-rw-r--r--Zend/zend_constants.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index 30ae65d267..72fa9cb177 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -309,7 +309,6 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
const char *colon;
zend_class_entry *ce = NULL;
zend_string *class_name;
- zval *ret_constant;
/* Skip leading \\ */
if (name[0] == '\\') {
@@ -317,13 +316,13 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
name_len -= 1;
}
-
if ((colon = zend_memrchr(name, ':', name_len)) &&
colon > name && (*(colon - 1) == ':')) {
int class_name_len = colon - name - 1;
int const_name_len = name_len - class_name_len - 2;
zend_string *constant_name = STR_INIT(colon + 1, const_name_len, 0);
zend_string *lcname;
+ zval *ret_constant = NULL;
class_name = STR_INIT(name, class_name_len, 0);
lcname = STR_ALLOC(class_name_len, 0);
@@ -381,7 +380,11 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
}
STR_FREE(class_name);
STR_FREE(constant_name);
- goto finish;
+ if (retval) {
+ zval_update_constant_ex(ret_constant, (void*)1, ce TSRMLS_CC);
+ ZVAL_DUP(result, ret_constant);
+ }
+ return retval;
}
/* non-class constant */
@@ -425,14 +428,7 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
name_len = const_name_len;
return zend_get_constant(name, name_len, result TSRMLS_CC);
}
- retval = 0;
-finish:
- if (retval) {
- zval_update_constant_ex(ret_constant, (void*)1, ce TSRMLS_CC);
- ZVAL_DUP(result, ret_constant);
- }
-
- return retval;
+ return 0;
}
return zend_get_constant(name, name_len, result TSRMLS_CC);