[Issue 851] New: strange bug when a delegate access a member variable.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 16 18:52:43 PST 2007


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

           Summary: strange bug when a delegate access a member variable.
           Product: D
           Version: 1.00
          Platform: PC
               URL: http://dsource.org/projects/qonkd/browser/trunk/bug
        OS/Version: Linux
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: rodolfo.borges at gmail.com


I was implementing a menu system for my game, when I found this bug.
The menu item object is created with a delegate for the action to be taken.
When I pass a member function as the delegate, and it tries to access a member
variable, it crashes.

The funny thing is (that helped me think it can be a dmd bug), if the calling
part is inside a loop or function, it crashes, but if it's inside the main, it
works ok.  Check the version(crash) part in main.d to see what I'm talking
about.

The menu.d file is unchanged, but I tried and made main.d the minimum possible
to reproduce the bug.  I hope it's clear enough.

http://dsource.org/projects/qonkd/browser/trunk/bug


-- 



More information about the Digitalmars-d-bugs mailing list