[Issue 1125] New: Segfault using tuple in asm code,	when size not specified
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Apr 11 13:37:47 PDT 2007
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=1125
           Summary: Segfault using tuple in asm code, when size not
                    specified
           Product: D
           Version: 1.011
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: clugdbug at yahoo.com.au
----------
void a(X...)(X expr)
{
    asm {
        mov EAX, expr[0];
    }
}
void main()
{
   a(1);
}
---------
There is a workaround: use
  mov EAX, int ptr expr[0];
Unfortunately, this does not work in the case I want it, when properties
are involved:
(gives an "end of instruction" error).
-----------
void a(X...)(X expr)
{
    asm {
        mov EAX, int ptr expr[0].ptr;
    }
}
void main()
{
    int [] b = [1, 2, 3];
   a(b);
}
-------
There may be a bit more going on here (.ptr may be misrecognised as the asm
'ptr' keyword).
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list