This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Protect against dereferencing a null pointer
ClosedPublic

Authored by alexander-shaposhnikov on Jan 22 2018, 11:35 AM.

Details

Summary

The check (inside StackHintGeneratorForSymbol::getMessage)

if (!N)
    return getMessageForSymbolNotFound()

is moved to the beginning of the function.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ accepted this revision.Jan 22 2018, 11:40 AM
NoQ added a reviewer: george.karpenkov.

Neat. I wonder if you've actually found it by running the analyzer :) Did it crash or just made sense to fix, i.e. should there be tests?

This revision is now accepted and ready to land.Jan 22 2018, 11:40 AM

no, i have not seen any crashes related to this particular case, but i've been working on a fix for a separate issue (a bit more involved) (not far from here) (I will send a diff for review soon)
and decided to clean it up as well.

This revision was automatically updated to reflect the committed changes.