[Issue 11594] synchronized causing segfault instead of Error.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jul 6 03:51:41 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=11594

--- Comment #3 from github-bugzilla at puremagic.com ---
Commit pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/a2ead6dd04efdfeb283b72daf167e85fe8db9c49
Fix issue 11594: Check if the monitor is null in _d_monitorenter

In case of

```
        synchronized (null)
        {
                // ...
        }
```

runtime will try to access __monitor field on a null,
without checking if it's a null and it will segfault,
leaving programmer clueless.

https://issues.dlang.org/show_bug.cgi?id=11594

--


More information about the Digitalmars-d-bugs mailing list