summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-09-12 22:48:08 +0000
committerJordan Rose <jordan_rose@apple.com>2012-09-12 22:48:08 +0000
commit5297748e3f964788d7defdbc1be5c927f334fb31 (patch)
treeea8e2dd4d529ee94fdbd44c1a7e5f35ea7c6318c /clang/lib
parent2010d437f9e530989add788f0cef5a65c7dc5aed (diff)
downloadbcm5719-llvm-5297748e3f964788d7defdbc1be5c927f334fb31.tar.gz
bcm5719-llvm-5297748e3f964788d7defdbc1be5c927f334fb31.zip
[analyzer] Fix another use of the address of a temporary, like r163402.
Again, GCC is more aggressive about reusing temporary space than we are, leading to Release build crashes for this undefined behavior. PR13710 (though it may not be the only problem there) llvm-svn: 163747
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
index 46acea78a8e..6cbed952c9f 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -1280,7 +1280,8 @@ static void GenerateExtensivePathDiagnostic(PathDiagnostic& PD,
}
if (const BlockEntrance *BE = dyn_cast<BlockEntrance>(&P)) {
- if (const CFGStmt *S = BE->getFirstElement().getAs<CFGStmt>()) {
+ CFGElement First = BE->getFirstElement();
+ if (const CFGStmt *S = First.getAs<CFGStmt>()) {
const Stmt *stmt = S->getStmt();
if (IsControlFlowExpr(stmt)) {
// Add the proper context for '&&', '||', and '?'.
OpenPOWER on IntegriCloud