[analyzer] Fix a crash on accessing a field within a literal-initialized union.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 22 Nov 2016 04:29:23 +0000 (04:29 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 22 Nov 2016 04:29:23 +0000 (04:29 +0000)
commit22e28f40785cbb9b78f52c551ac03a461ab39eb8
treedc95ce108b49e4948830ab5b18d28a1d87b53ae7
parent1d75de00e8877cc4c910b01d5b8100d847ae8527
[analyzer] Fix a crash on accessing a field within a literal-initialized union.

Because in case of unions we currently default-bind compound values in the
store, this quick fix avoids the crash for this case.

Patch by Ilya Palachev and independently by Alexander Shaposhnikov!

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

llvm-svn: 287618
clang/lib/StaticAnalyzer/Core/RegionStore.cpp
clang/test/Analysis/uninit-vals-union.c [new file with mode: 0644]