From 7316b3f7d1606d78adc781471e2513166c5640d0 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 20 Jan 2025 18:43:11 +0100 Subject: [PATCH] Drop misleading comments about undefined behavior There is no undefined behavior here. If `BitScan*()` returns zero, the value written to the first parameter is undefined, but we return a reasonable value. --- Zend/zend_bitset.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Zend/zend_bitset.h b/Zend/zend_bitset.h index a42b35712f4e6..d990b6a2a871e 100644 --- a/Zend/zend_bitset.h +++ b/Zend/zend_bitset.h @@ -60,7 +60,6 @@ ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_ulong_ntz(zend_ulong num #else if (!BitScanForward(&index, num)) { #endif - /* undefined behavior */ return SIZEOF_ZEND_LONG * 8; } @@ -98,7 +97,6 @@ ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_ulong_nlz(zend_ulong num #else if (!BitScanReverse(&index, num)) { #endif - /* undefined behavior */ return SIZEOF_ZEND_LONG * 8; }