[Issue 5802] New: Pointer becoming invalid

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 30 22:00:17 PDT 2011


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

           Summary: Pointer becoming invalid
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: Jesse.K.Phillips+D at gmail.com


--- Comment #0 from Jesse Phillips <Jesse.K.Phillips+D at gmail.com> 2011-03-30 21:56:47 PDT ---
Created an attachment (id=936)
Example code

I've been working toward a CSV parser that works efficiently with an input
range. I'm testing it with string and have come to the conclusion there is a
bug in DMD. But I'm having some issue with reducing this code further[1].

The issue manifests itself when I pass a string to a function, which is stored
in a range that produces a range that stores a pointer to the string, which
modifies the dereferenced string pointer.

The pointer is no longer valid by the time popFront is called. A segmentation
fault is produced on line 95 inside countUntil (the string is garbage).

1. https://gist.github.com/895807

-- 
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