[Issue 807] inout params don't mesh with fpu

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 2 01:16:32 PST 2007


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


bugzilla at digitalmars.com changed:

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




------- Comment #1 from bugzilla at digitalmars.com  2007-02-02 03:16 -------
inout parameters are passed by reference, i.e. they are actually a pointer. The
sample code is using inline assembler, referencing the inout parameter. So, the
inline assembler:

    void foo(inout real r)
    {
        asm
        {   fld r;

is actually loading a *pointer* and treating it as if it were a real.

Inline assembler does exactly what you tell it to do. To make the above work,
use instead:
            mov EAX,r ;
            fld real ptr [EAX] ;

Not a compiler bug.


-- 



More information about the Digitalmars-d-bugs mailing list