Comment #0 by dlang-bugzilla — 2015-03-31T00:01:55Z
////////// test.d /////////
import core.bitop : bsf;
void main()
{
foreach (_; 0 .. 1)
{
int j = bsf(0) < 0;
assert(j == 0);
}
}
///////////////////////////
On Ubuntu Linux 14.10, when compiled with DMD 2.067.0 (`dmd -m64 test.d`), the assert in the above program will fail 50% of the time the program is ran.
Reduced from Issue 14323.
Comment #1 by dlang-bugzilla — 2015-03-31T00:21:53Z
I just saw this in the documentation:
"The return value is undefined if v is zero."
So I guess this makes this bug report invalid. However, I think it would be appropriate if non-release builds had an assert check.