www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22748] New: ~this() nogc { synchronized ...... } liable to


          Issue ID: 22748
           Summary: ~this()  nogc { synchronized ...... } liable to
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: destructionator gmail.com

I don't have a minimized example, this came up in the middle of a large work
application, but examining the source code and the stack trace reveals the

The destructor is  nogc hoping to avoid these, but this slipped through. I'm
not sure if it should actually fail the nogc check (though it does fail a
nothrow check which is interesting but not necessarily a bug per se), but
regardless we should do something.

synchronized(this) calls ensureMontior which calls GC.setAttr which throws the
invalid memory operation error.

Feb 08 2022