www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20750] New: checkaction=context segfaults for null references

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

          Issue ID: 20750
           Summary: checkaction=context segfaults for null references
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: moonlightsentinel disroot.org

The following code segfaults when compiled with -checkaction=context:

=======================================

void main()
{
    Object o = null;
    assert(o !is o);
}

=======================================

This segfaults because miniFormat unconditionally calls toString on a null
reference.

--
Apr 19 2020