www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17282] New: std.conv.parse throws with -debug

https://issues.dlang.org/show_bug.cgi?id=17282

          Issue ID: 17282
           Summary: std.conv.parse throws with -debug
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: freeslave93 gmail.com

This code

import std.conv;

void main()
{
    import std.stdio;
    auto str = "0=\x00\x02\x55\x40&\xff\xf0\n\x00\x04\x55\x40\xff\xf0~4+10\n";
    writeln(parse!uint(str));
}

throws "UTFException" when compiled with '-debug', but does not throw
otherwise.

I believe this is not expected behavior. std.conv.parse should not care about
the rest of the content, and just stop after reading the number.

--
Mar 28 2017