[analyzer] pr36458: Fix retrieved value cast for symbolic void pointers.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 4 May 2018 22:11:12 +0000 (22:11 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 4 May 2018 22:11:12 +0000 (22:11 +0000)
commite603e076f5b3ac7a5c31c4329abdc6cdc2db58e2
tree4b3cbbafb4c0d40906b55fbf1a62ad677179b894
parent806486c7818ece98a00fb0ed988b2a3dd982f5c4
[analyzer] pr36458: Fix retrieved value cast for symbolic void pointers.

C allows us to write any bytes into any memory region. When loading weird bytes
from memory regions of known types, the analyzer is required to make sure that
the loaded value makes sense by casting it to an appropriate type.

Fix such cast for loading values that represent void pointers from non-void
pointer type places.

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

llvm-svn: 331562
clang/lib/StaticAnalyzer/Core/Store.cpp
clang/test/Analysis/casts.c