Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ab99693

Browse files
authored
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.
1 parent d6c6675 commit ab99693

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

‎Zend/zend_bitset.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_ulong_ntz(zend_ulong num
6060
#else
6161
if (!BitScanForward(&index, num)) {
6262
#endif
63-
/* undefined behavior */
6463
return SIZEOF_ZEND_LONG * 8;
6564
}
6665

@@ -98,7 +97,6 @@ ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_ulong_nlz(zend_ulong num
9897
#else
9998
if (!BitScanReverse(&index, num)) {
10099
#endif
101-
/* undefined behavior */
102100
return SIZEOF_ZEND_LONG * 8;
103101
}
104102

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /