[Issue 1648] New: Casting a function literal to void* swallows the function or segfaults

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 8 06:04:10 PST 2007


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

           Summary: Casting a function literal to void* swallows the
                    function or segfaults
           Product: D
           Version: 2.007
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: dhasenan at gmail.com


When saving a delegate as a void* and only using one delegate from the same
function, attempts to execute the delegate by casting to the original type do
nothing.

When saving multiple delegates from the same function, if any of them are cast
to void*, a segmentation fault occurs.

Casting is inherently dangerous, I know, but there's no other way to pass a
delegate while ignoring its type.


-- 



More information about the Digitalmars-d-bugs mailing list