[Issue 5974] Incorrect nested function address in expression (&f).ptr

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 18 19:10:46 PST 2012


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


yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies at gmail.com


--- Comment #2 from yebblies <yebblies at gmail.com> 2012-01-19 14:10:45 EST ---
(In reply to comment #0)
> Second, why "&f is not an lvalue" error occurs for "(&f).funcptr"? Maybe, I
> don't understand something?

iirc this fails because dmd rewrites dg.funcptr as *(cast(void**)(&dg)+1),
which naturally doesn't work on an rvalue.  The way to fix this is to rewrite
it as cast(void*)(cast(uint<64/128>)dg >> <32/64>), the same way array length
is accessed.

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


More information about the Digitalmars-d-bugs mailing list