www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1096] New: Mysterious hang with toUTCString + UTCtoLocalTime + d_time_nan

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1096

           Summary: Mysterious hang with toUTCString + UTCtoLocalTime +
                    d_time_nan
           Product: D
           Version: 1.009
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: daniel.keep+d.puremagic.com gmail.com


Using the below program:

-----
module timetest;

import std.stdio;
import std.date;

void main(char[][] args)
{
    foreach( arg ; args[1..$] )
    {
        auto time = parse(arg);
        time = UTCtoLocalTime(time); //  Line 11
        auto str = toUTCString(time); // Line 12
        writefln(`"%s" = %s (%s)`, arg, time, str);
    }
}
-----

If I compile this and call it like this:

$ timetest "Jan 1"

The program hangs.  If I comment out UTCtoLocalTime, and re-run with the same
arguments, it outputs

"Jan 1" = -9223372036854775808 (Invalid Date)

Now it gets weird.  If I un-comment line 11 and comment line 12 (replace the
"str" arg to writefln with ""), I get:

"Jan 1" = -9223372036818775808 ()

And if I then comment-out line 11 again, rerun, I get:

"Jan 1" = -9223372036854775808 ()

So, for some reason, toUTCString fails on d_time_nan iif it has been passed
through UTCtoLocalTime, despite the fact that UTCtoLocalTime doesn't change the
value.


-- 
Apr 05 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1096


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed DMD 1.013


-- 
Apr 20 2007