www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 91] New: String literals not always properly zero-terminated

http://bugzilla.gdcproject.org/show_bug.cgi?id=91


           Summary: String literals not always properly zero-terminated
    Classification: Unclassified
           Product: GDC
           Version: development
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: Normal
         Component: gdc
        AssignedTo: ibuclaw gdcproject.org
        ReportedBy: johannespfau gmail.com


test.d:
-------------
void main()
{
    string s = "0x1.FFFFFFFFFFFFFFFEp-16382";
    s = "abcde";//Breakpoint here
}
-------------

gdc -g test.d
gdb a.out
break test.d:4
run
print s.ptr
$2 = 0x433964 "0x1.", 'F' <repeats 15 times>, "Ep-16382abcde"

(Note that the first string isn't zero-terminated)

Seems to be GDC specific, I can't reproduce this with DMD.

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
Jan 12 2014