summaryrefslogtreecommitdiffstats
path: root/clang/Analysis/ValueState.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Analysis/ValueState.cpp')
-rw-r--r--clang/Analysis/ValueState.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/Analysis/ValueState.cpp b/clang/Analysis/ValueState.cpp
index 963864662a9..5796238d48d 100644
--- a/clang/Analysis/ValueState.cpp
+++ b/clang/Analysis/ValueState.cpp
@@ -252,6 +252,10 @@ RValue ValueStateManager::GetValue(ValueState St, Expr* E, bool* hasVal) {
case Stmt::ImplicitCastExprClass: {
ImplicitCastExpr* C = cast<ImplicitCastExpr>(E);
QualType CT = C->getType();
+
+ if (CT->isVoidType())
+ return UnknownVal();
+
QualType ST = C->getSubExpr()->getType();
if (CT == ST || (CT->isPointerType() && ST->isFunctionType())) {
@@ -266,6 +270,9 @@ RValue ValueStateManager::GetValue(ValueState St, Expr* E, bool* hasVal) {
QualType CT = C->getType();
QualType ST = C->getSubExpr()->getType();
+ if (CT->isVoidType())
+ return UnknownVal();
+
if (CT == ST || (CT->isPointerType() && ST->isFunctionType())) {
E = C->getSubExpr();
continue;
OpenPOWER on IntegriCloud