April 21, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1172

           Summary: Inline assembler: cannot access member of templated
                    aggregate directly
           Product: D
           Version: 1.013
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: deewiant@gmail.com


struct Foo(T) {
        int a;
}

void main() {
        Foo!(int) f;
        asm {
                mov EBX, f;
                mov EAX, Foo!(int).a[EBX];
        }
}

The code above is essentially the same as what is under "Struct/Union/Class Member Offsets" at http://www.digitalmars.com/d/iasm.html but fails with the error "bad type/size of operands 'Foo(T)'".

The workaround is to use an alias:

alias Foo!(int) Foo_int;
asm {
        mov EBX, f;
        mov EAX, Foo_int.a[EBX];
}


-- 

April 23, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1172


thomas-dloop@kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All




------- Comment #1 from thomas-dloop@kuehne.cn  2007-04-23 12:55 -------
Added to DStress as http://dstress.kuehne.cn/run/a/asm_04_A.d http://dstress.kuehne.cn/run/a/asm_04_B.d http://dstress.kuehne.cn/run/a/asm_04_C.d http://dstress.kuehne.cn/run/a/asm_04_D.d


--