summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-02-25 13:21:03 +0400
committerDmitry Stogov <dmitry@zend.com>2014-02-25 13:21:03 +0400
commit820184dd00a9997426522ce70026f7ef5f556e41 (patch)
tree723ee8682711617ee63baef8d9453d82195c0214
parent4e63cf9b1636553177be44d53baf2a8d82f5b100 (diff)
downloadphp-git-820184dd00a9997426522ce70026f7ef5f556e41.tar.gz
Fixed converting IS_REFERENCE to string
-rw-r--r--Zend/zend.c8
-rw-r--r--Zend/zend_operators.c14
2 files changed, 10 insertions, 12 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 532cdf35e2..fbb5c07de5 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -225,6 +225,14 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
*use_copy = 0;
return;
}
+ if (Z_TYPE_P(expr) == IS_REFERENCE) {
+ expr = Z_REFVAL_P(expr);
+ if (Z_TYPE_P(expr) == IS_STRING) {
+ ZVAL_STR(expr_copy, Z_STR_P(expr));
+ *use_copy = 1;
+ return;
+ }
+ }
switch (Z_TYPE_P(expr)) {
case IS_NULL:
Z_STR_P(expr_copy) = STR_EMPTY_ALLOC();
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 9b46ae4456..849f4d3bd3 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1425,20 +1425,10 @@ ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend
int use_copy1 = 0, use_copy2 = 0;
if (Z_TYPE_P(op1) != IS_STRING) {
- if (Z_TYPE_P(op1) == IS_REFERENCE) {
- op1 = Z_REFVAL_P(op1);
- }
- if (Z_TYPE_P(op1) != IS_STRING) {
- zend_make_printable_zval(op1, &op1_copy, &use_copy1);
- }
+ zend_make_printable_zval(op1, &op1_copy, &use_copy1);
}
if (Z_TYPE_P(op2) != IS_STRING) {
- if (Z_TYPE_P(op2) == IS_REFERENCE) {
- op2 = Z_REFVAL_P(op2);
- }
- if (Z_TYPE_P(op2) != IS_STRING) {
- zend_make_printable_zval(op2, &op2_copy, &use_copy2);
- }
+ zend_make_printable_zval(op2, &op2_copy, &use_copy2);
}
if (use_copy1) {