www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8088] New: Inline assembler: Indexing struct fields not possible

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

           Summary: Inline assembler: Indexing struct fields not possible
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com



07:37:14 MSD ---
Example from http://dlang.org/iasm.html:
---
struct Foo { int a,b,c; }
int bar(Foo *f) {
    asm {
        mov EBX, f;
        mov EAX, Foo.b[EBX];
    }
}
---
main.d(5): Error: variable b cannot be read at compile time

Also see Issue 5302

Workaround: add .offsetof

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 11 2012