www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8448] New: Take address of label (at least in inline asm)

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8448

           Summary: Take address of label (at least in inline asm)
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dmitry.olsh gmail.com


--- Comment #0 from Dmitry Olshansky <dmitry.olsh gmail.com> 2012-07-26
14:11:39 PDT ---
See also NG discussion:
http://forum.dlang.org/thread/gltqflqrvsxggarxjkde forum.dlang.org?page=5

So address of label can be taken via some asm trick:

size_t address;
asm{
call L_label;
add EAX, 4;
move address, EAX
}
//OK now address points where needed

...

L_label:
asm{
move EAX, [ESP];
ret; 
}
//<<--- want code pointer here
....

The request is to allow direct use of label addresses in contexts other then
jump/call:
lea, mov,  etc. 

An extension of that would be to introduce taking of label address in normal D
code to aid portability, but that's the whole other question.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 26 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8448


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from yebblies <yebblies gmail.com> 2012-12-27 18:27:59 EST ---
*** This issue has been marked as a duplicate of issue 1829 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 26 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8448


Talha Zekeriya DurmuĊŸ <talhazekeriyadurmus gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P5
                 CC|                            |talhazekeriyadurmus gmail.c
                   |                            |om
           Severity|enhancement                 |critical


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8448



--- Comment #2 from yebblies <yebblies gmail.com> 2013-01-05 22:51:10 EST ---
This bug has been closed as a duplicate of issue 1829, any updates and
discussion should go there.

There is also a list of definitions for the severity level here: (although the
priority level is mostly ignored)
http://d.puremagic.com/issues/page.cgi?id=fields.html#importance

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2013