[Issue 523] New: I think this is a GC bug

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 15 11:37:52 PST 2006


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

           Summary: I think this is  a GC bug
           Product: D
           Version: 0.175
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: theos at list.ru


I think that this is a bug in gc/compiler

char [] foo() {
  char [10] arr = "hello, wor";
  return arr[0..4]; // or return arr;
}

void main() {
  printf(foo());
}

doesn`t work - it prints some rubbish, so, as i guess, arr is collected
when function 'foo' returns. if I use char [] instead of char[10] all works
fine.


-- 




More information about the Digitalmars-d-bugs mailing list