[Issue 3363] New: std.stream.readf segfaults with immutable format strings

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 4 14:23:04 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3363

           Summary: std.stream.readf segfaults with immutable format
                    strings
           Product: D
           Version: 2.032
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: acehreli at yahoo.com


--- Comment #0 from Ali Cehreli <acehreli at yahoo.com> 2009-10-04 14:23:03 PDT ---
This program segfaults when run and receives an int from din:

import std.cstream;
void main()
{
    int i;
    din.readf("%d", &i);
}

The reason is because vreadf does not think that "%d" is a format string,
probably because the following 'is' expression doesn't match immutable
(char)[]:

  std/stream.d:694:    if (arguments[j] is typeid(char[])) {

The program above works as expected when readf receives "%d".dup

Ali

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


More information about the Digitalmars-d-bugs mailing list