1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Also use zval_get_double for op1 in pow comp time check

Mostly for consistency, but this will also allow evaluating more expressions at
compile time.
This commit is contained in:
Ilija Tovilo
2024-05-22 16:30:03 +02:00
parent 69e2ef694e
commit 2c91b7364b

View File

@@ -8992,7 +8992,7 @@ ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, const zval *op1, co
/* Division by zero throws an error. */
return 1;
}
if ((opcode == ZEND_POW) && zval_get_long(op1) == 0 && zval_get_double(op2) < 0) {
if ((opcode == ZEND_POW) && zval_get_double(op1) == 0 && zval_get_double(op2) < 0) {
/* 0 ** (<0) throws a division by zero error. */
return 1;
}