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
No known key found for this signature in database
GPG Key ID: A4F5D403F118200A

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. */ /* Division by zero throws an error. */
return 1; 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. */ /* 0 ** (<0) throws a division by zero error. */
return 1; return 1;
} }