www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1125] New: Segfault using tuple in asm code, when size not specified

reply d-bugmail puremagic.com writes:
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).


-- 
Apr 11 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1125


thomas-dloop kuehne.cn changed:

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





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


-- 
Apr 23 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1125






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.


-- 
Oct 20 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1125


clugdbug yahoo.com.au changed:

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






really a different bug.


-- 
Nov 14 2008