Thread overview
[Issue 1125] New: Segfault using tuple in asm code, when size not specified
Apr 11, 2007
d-bugmail
Apr 23, 2007
d-bugmail
Oct 20, 2007
d-bugmail
Nov 15, 2008
d-bugmail
April 11, 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@digitalmars.com
        ReportedBy: clugdbug@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).


-- 

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


thomas-dloop@kuehne.cn changed:

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




------- Comment #1 from thomas-dloop@kuehne.cn  2007-04-23 12:56 -------
Added to DStress as http://dstress.kuehne.cn/run/t/tuple_23_A.d http://dstress.kuehne.cn/run/t/tuple_23_B.d http://dstress.kuehne.cn/run/t/tuple_23_C.d


-- 

October 20, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1125





------- Comment #2 from braddr@puremagic.com  2007-10-20 03:57 -------
Most of the cases in this report are fixed, but the second one from Don (with or without the 'int ptr' part now), which contains 'expr[0].ptr' doesn't build still.  Same error.  That corresponds to the C test case from Thomas.


-- 

November 15, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1125


clugdbug@yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #3 from clugdbug@yahoo.com.au  2008-11-14 23:04 -------
Closing this issue, created #2455 for the remaining bug (dstress C) which is
really a different bug.


--