[Issue 1332] New: Internal error: ../ztc/cod4.c 357

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 11 06:47:15 PDT 2007


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

           Summary: Internal error: ../ztc/cod4.c 357
           Product: D
           Version: 1.018
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: fvbommel at wxs.nl


=====
urxae at urxae:~/tmp$ dmd test.d -c -g
urxae at urxae:~/tmp$ dmd test.d -c -gc
urxae at urxae:~/tmp$ dmd test.d -c -O
urxae at urxae:~/tmp$ dmd test.d -c -g -O
Internal error: ../ztc/cod4.c 357
urxae at urxae:~/tmp$ dmd test.d -c -gc -O
Internal error: ../ztc/cod4.c 357
====
As you can see, both (-g or -gc) and -O must be specified for the error to
occur.

The source:
---
void recurse(inout int i) {
    int j = i;
    recurse(j);
}
---
The argument must be inout, and the argument to the recursive invocation must
depend on the value of the original argument. If 'j' is initialized to '0',
'i*0' or similar it compiles fine. If it's initialized to 'i', 'i+1', etc. it
errors out.
If the parameter type is a struct (or a pointer to one) and the recursive
invocation uses a value derived from a field as parameter it also errors out.
(e.g. 'Node* n'/'n.next' or 'Node n'/'*n.next' as formal parameter/argument
pair)


-- 



More information about the Digitalmars-d-bugs mailing list