[Issue 2317] New: asm offsetof generates: Internal error: ../ztc/cod3.c 2651

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 27 04:31:19 PDT 2008


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

           Summary: asm offsetof generates: Internal error: ../ztc/cod3.c
                    2651
           Product: D
           Version: 1.034
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: manuelk89 at gmx.net


// file main.d

struct Foo
{
        // Use one of these lines at a time

        //float x;    // OK
        float x,y;  // ERROR
        //float[0] x; // OK
        //float[1] x; // OK
        //float[2] x; // ERROR
        //float[3] x; // ERROR

        //int x;    // OK
        //int x,y;  // ERROR
        //int[2] x; // ERROR

        //char x;    // OK
        //char x,y;  // OK !!
        //char[2] x; // OK !!

        //dchar x,y;  // ERROR
        //dchar[2] x; // ERROR
}

void bar(Foo f)
{
  asm
  {
    // bug seems to arise whenever 'offsetof f' is used
    mov EAX, offsetof f;
  }
}

---------------
$  dmd main.d
Internal error: ../ztc/cod3.c 2651

This error seems to arise whenever the struct has more than one "field" (either
as real variable field or even as array), but interestingly it works for char.
'f' has to be a parameter, it compiles fine when declared as a global or local
var.


-- 



More information about the Digitalmars-d-bugs mailing list