https://d.puremagic.com/issues/show_bug.cgi?id=12419

           Summary: assertion failure in std.utf
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Dmitry Olshansky <[email protected]> 2014-03-20 
02:19:24 PDT ---
Test code:

import std.utf;

void main()
{
    char[4] val;
    val[0] = 0b1111_0111;
    val[1] = 0b1011_1111;
    val[2] = 0b1011_1111;
    val[3] = 0b1011_1111;
    size_t i = 0;
    dchar ch = decode(val[], i); //must have thrown exception
}

Instead:
[email protected](950): Assertion failure

The trick is that encoded value (0x1FFFFF) is way beyond the standard range
[0,0x10FFFF] and then the out contract of decode fails.

std.utf.decode must throw on 4 byte sequence with values above 0x10_FFFF.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to