summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/opcache/jit/zend_jit_x86.dasc3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index 5c827f4b99..107e2c5de8 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -1613,6 +1613,7 @@ static uint32_t ones32(uint32_t x)
static uint32_t floor_log2(uint32_t x)
{
+ ZEND_ASSERT(x != 0);
x |= (x >> 1);
x |= (x >> 2);
x |= (x >> 4);
@@ -1623,7 +1624,7 @@ static uint32_t floor_log2(uint32_t x)
static zend_bool is_power_of_two(uint32_t x)
{
- return !(x & (x - 1));
+ return !(x & (x - 1)) && x != 0;
}
static zend_bool has_concrete_type(uint32_t value_type)