Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address code review comments
  • Loading branch information
kocsismate committed May 8, 2020
commit 0b5adb0cd66b2383f2b1a0bd6b201d76f538c99a
10 changes: 1 addition & 9 deletions Zend/zend_operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,12 +605,6 @@ ZEND_API void ZEND_FASTCALL convert_to_boolean(zval *op) /* {{{ */
}
/* }}} */

ZEND_API void ZEND_FASTCALL _convert_to_cstring(zval *op) /* {{{ */
{
_convert_to_string(op);
}
/* }}} */

ZEND_API void ZEND_FASTCALL _convert_to_string(zval *op) /* {{{ */
{
try_again:
Expand Down Expand Up @@ -945,9 +939,7 @@ static zend_always_inline zend_string* __zval_get_string_func(zval *op, zend_boo
return zend_long_to_str(Z_LVAL_P(op));
}
case IS_DOUBLE: {
zend_string *str = zend_strpprintf_unchecked(0, "%.*H", (int) EG(precision), Z_DVAL_P(op));

return str;
return zend_strpprintf_unchecked(0, "%.*H", (int) EG(precision), Z_DVAL_P(op));
}
case IS_ARRAY:
zend_error(E_WARNING, "Array to string conversion");
Expand Down
2 changes: 0 additions & 2 deletions Zend/zend_operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ ZEND_API int ZEND_FASTCALL increment_function(zval *op1);
ZEND_API int ZEND_FASTCALL decrement_function(zval *op2);

ZEND_API void ZEND_FASTCALL convert_scalar_to_number(zval *op);
ZEND_API void ZEND_FASTCALL _convert_to_cstring(zval *op);
ZEND_API void ZEND_FASTCALL _convert_to_string(zval *op);
ZEND_API void ZEND_FASTCALL convert_to_long(zval *op);
ZEND_API void ZEND_FASTCALL convert_to_double(zval *op);
Expand Down Expand Up @@ -340,7 +339,6 @@ static zend_always_inline zend_bool try_convert_to_string(zval *op) {
#define _zval_get_double_func(op) zval_get_double_func(op)
#define _zval_get_string_func(op) zval_get_string_func(op)

#define convert_to_cstring(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_cstring((op)); }
#define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op)); }


Expand Down
2 changes: 1 addition & 1 deletion ext/pgsql/pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -1987,7 +1987,7 @@ PHP_FUNCTION(pg_query_params)
zval tmp_val;

ZVAL_COPY(&tmp_val, tmp);
convert_to_cstring(&tmp_val);
convert_to_string(&tmp_val);
if (Z_TYPE(tmp_val) != IS_STRING) {
php_error_docref(NULL, E_WARNING,"Error converting parameter");
zval_ptr_dtor(&tmp_val);
Expand Down