From ab996934ebb954d8db0c18fee0b789c1500d9896 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 26 Jan 2025 22:50:52 +0100 Subject: [PATCH] Drop misleading comments about undefined behavior (GH-17532) 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 a42b35712f4..d990b6a2a87 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; }