diff options
Diffstat (limited to 'lib/StaticAnalyzer/Core/SValBuilder.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/SValBuilder.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Core/SValBuilder.cpp b/lib/StaticAnalyzer/Core/SValBuilder.cpp index 652809777c..9d77a3ef58 100644 --- a/lib/StaticAnalyzer/Core/SValBuilder.cpp +++ b/lib/StaticAnalyzer/Core/SValBuilder.cpp @@ -268,13 +268,18 @@ Optional<SVal> SValBuilder::getConstantVal(const Expr *E) { // If we don't have a special case, fall back to the AST's constant evaluator. default: { + // Don't try to come up with a value for materialized temporaries. + if (E->isGLValue()) + return None; + ASTContext &Ctx = getContext(); llvm::APSInt Result; if (E->EvaluateAsInt(Result, Ctx)) return makeIntVal(Result); - if (E->isNullPointerConstant(Ctx, Expr::NPC_ValueDependentIsNotNull)) - return makeNull(); + if (Loc::isLocType(E->getType())) + if (E->isNullPointerConstant(Ctx, Expr::NPC_ValueDependentIsNotNull)) + return makeNull(); return None; } |