[Issue 4309] String literal passed by ref causes segfault

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 15 07:03:08 PDT 2010


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


Lionello Lunesu <lio+bugzilla at lunesu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lio+bugzilla at lunesu.com
         OS/Version|Linux                       |All


--- Comment #1 from Lionello Lunesu <lio+bugzilla at lunesu.com> 2010-07-15 07:03:05 PDT ---
You're lucky if it segfaults. On Windows, it changes my literals, even dupped
ones:

--------- refs.d
void X(ref string s)
{
    assert(s[0] == 'a');
    s = s[1..$];
}

void main()
{
    X("ab");    
    X("ab");    
}

core.exception.AssertError at refs(3): Assertion failure
Digital Mars D Compiler v2.047

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