diff options
Diffstat (limited to 'lib/Checker/Environment.cpp')
-rw-r--r-- | lib/Checker/Environment.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Checker/Environment.cpp b/lib/Checker/Environment.cpp index 7bf2929161..954129883d 100644 --- a/lib/Checker/Environment.cpp +++ b/lib/Checker/Environment.cpp @@ -63,7 +63,12 @@ SVal Environment::getSVal(const Stmt *E, SValBuilder& svalBuilder) const { if (CT->isVoidType()) return UnknownVal(); if (C->getCastKind() == CK_NoOp) { - E = C->getSubExpr(); + // If the no-op cast has value, use it. Should we always propagate + // values through all levels of no-op casts? + if (const SVal* X = ExprBindings.lookup(C)) + return *X; + else + E = C->getSubExpr(); continue; } break; |