[analyzer] Protect against dereferencing a null pointer
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Mon, 22 Jan 2018 20:18:42 +0000 (20:18 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Mon, 22 Jan 2018 20:18:42 +0000 (20:18 +0000)
commit429a73d17b0cb222560c447fab5570184dee582e
tree1922b3d00f897d729db7fe1b32e286bea0493a1a
parent39491d7b6098f96eb1f88d68068eb654c1e2bd81
[analyzer] Protect against dereferencing a null pointer

The check (inside StackHintGeneratorForSymbol::getMessage)
if (!N)
    return getMessageForSymbolNotFound()
is moved to the beginning of the function.

Differential revision: https://reviews.llvm.org/D42388

Test plan: make check-all

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323146 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/PathDiagnostic.cpp