From 2c91b7364b854a6e1e5f02081653fa60ffbd83d4 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 22 May 2024 16:30:03 +0200 Subject: [PATCH] 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. --- Zend/zend_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index fd803cf20d0..a97c46ca914 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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; }