[Issue 523] I think this is a GC bug
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Dec 1 00:53:03 PST 2006
http://d.puremagic.com/issues/show_bug.cgi?id=523
bugzilla at digitalmars.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
------- Comment #1 from bugzilla at digitalmars.com 2006-12-01 02:52 -------
char[10] arr;
allocates arr on the stack. Returning a pointer to the stack will result in
corrupted data.
char[] arr = "string";
will make arr a reference to the static data literal "string", which is in the
static data segment and so remains valid when the function exits.
Not a compiler or gc bug.
--
More information about the Digitalmars-d-bugs
mailing list