<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/97626>97626</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            llvm/lib/Transforms/Utils/Debugify.cpp:240:54: warning: Possible null pointer dereference 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            llvm,
            llvm:transforms
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dcb314
      </td>
    </tr>
</table>

<pre>
    Static analyser cppcheck says:

llvm/lib/Transforms/Utils/Debugify.cpp:240:54: warning: Possible null pointer dereference if the default parameter value is used: DebugInfoBeforePass [nullPointerDefaultArg]

Source code is 

 return collectDebugInfoMetadata(M, M.functions(), *DebugInfoBeforePass,
                                  "ModuleDebugify (original debuginfo)",
 NameOfWrappedPass);

I don't see any sanity check that DebugInfoBeforePass is non-null.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8k82OozgUhZ_msrEqcq5JERYsSEWRapGZkmpGszb2NXjasZF_qpW3b0HSXVmU1LtmwY-NvnPu4SBTsqMn6mB3gN2xkiVPIXZaDWJbV0PQ1-49y2wVk166a6LI1DyridQ3luQ1geiBH4Hfz859XABPzg6Ap3-i9MmEeEmAp3-zdcv1SEMZrblu1DyD6LHmIPpdDaJn32X01o_L7VtIyQ6OmC_OsTlYnykyTZEMRfKKmDUsT8Q0GVlcZrOM8kLLSx_SFWI2sZJIL6xV8dWbcCATIr3JlBjsDgv57QY-3iB9HGF3fBznPZSoiKmgV-LjFouUS_RMBedI5V8iZ8pSyywB92fAF3bemOJVtsEnwD1guywC9l-4Any5s397AOI56OLoZ5wMcB-iHa2Xjul10ZuwyuEn9y95ob_Nf1HOM-mbZAvi8DjXK9PBAzaZJSIm_ZUl6W2-sts3z5PMXyZqE_PBPy2pbirdCd2KVlbUbRvkXOxq0VRTxxuBWyNqQ6rWCknsFSJyajVyY3Z1ZTvkWPOGi20rmm2z4a2oSdVqUIrEsxZQc7pI6zZL0zYhjpVNqVDXNs_4XDk5kEtrlxFvXVynvz-IPj9UEpe-x27ZeRrKmKDmzqacPtHZZkfdn-t0VaLrppzn9bfCE-BptHkqw0aF1cLdyeJ4juF_UhnwtAaw2Lhl8NHhjwAAAP__i1A4ZQ">