[phobos] master phobos brunch, weird bug

Dmitry Olshansky dmitry.olsh at gmail.com
Tue Mar 29 13:33:19 PDT 2011


I just forked latest phobos and cloned druntime to my dmd 2.052 distro 
(I specifically obliterated the old sources) then rebuilt the whole 
package, and stumbled on a  _very strange_ issue when running unittest, 
the vanilla output:
unittest
core.exception.AssertError at std.conv(2509): unittest failure
----------------
core.exception.AssertError at std\json.d(459): 1223 should be 1.223e+24
----------------
...
Closer examination shows that this test fails:
f = to!float( "123e+2" );
assert( f == 123e+2f ); //replacing with writeln shows... 123  WTF??!
And then mystery continues as placing writeln in one branch of parse 
makes it work again!
(but fills screen with neat column of numbers)
At conv.d:1569
...
         while (exp > 0)
         {
             while (exp >= pow)
             {
                 ldval *= postab[u];
                 exp -= pow;
                 writeln(u);  // <<<< here!
             }
             pow >>= 1;
             u++;
         }
...
I'm on Win7/64bit.
*Any* ideas? Can someone reproduce it? Auto-tester seems to run 32bit 
Windows only.

-- 
Dmitry Olshansky



More information about the phobos mailing list