[analyzer] Only attempt to get the value of locations of known type
authorGeorge Karpenkov <ekarpenkov@apple.com>
Tue, 27 Feb 2018 19:28:52 +0000 (19:28 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Tue, 27 Feb 2018 19:28:52 +0000 (19:28 +0000)
commit53c1c10bebf401c2a1e5492725b56ba91cc62477
tree02dc9d8ff3456d17e7e2641223b461d057b165cc
parentfc0d02cbbfaaa91bf09666bffb2c2f64342bdd07
[analyzer] Only attempt to get the value of locations of known type

Fixes https://bugs.llvm.org/show_bug.cgi?id=36474

In general, getSVal API should be changed so that it does not crash on
some non-obvious conditions.
It should either be updated to require a type, or to return Optional<SVal>.

Differential Revision: https://reviews.llvm.org/D43801

llvm-svn: 326233
clang/lib/StaticAnalyzer/Checkers/NonnullGlobalConstantsChecker.cpp
clang/test/Analysis/novoidtypecrash.c [new file with mode: 0644]