Skip to content

Commit af5b12e

Browse files
committed
Use safe version and comment
1 parent a4ce5b3 commit af5b12e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_operators.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,12 +464,12 @@ ZEND_API void ZEND_FASTCALL convert_to_long(zval *op) /* {{{ */
464464
case IS_LONG:
465465
break;
466466
case IS_DOUBLE:
467-
// TODO Use safe variant?
468-
ZVAL_LONG(op, zend_dval_to_lval(Z_DVAL_P(op)));
467+
ZVAL_LONG(op, zend_dval_to_lval_safe(Z_DVAL_P(op)));
469468
break;
470469
case IS_STRING:
471470
{
472471
zend_string *str = Z_STR_P(op);
472+
/* zval_get_long will check if float string is integer compatible */
473473
ZVAL_LONG(op, zval_get_long(op));
474474
zend_string_release_ex(str, 0);
475475
}

0 commit comments

Comments
 (0)