summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-05-08 18:22:25 +0000
committerBill Wendling <isanbard@gmail.com>2012-05-08 18:22:25 +0000
commit6a49deb6e9c2e71af98336c21c227e4ceff41ecb (patch)
tree90f06b9d2c156bffc8b13842ff672c9abf84295e
parente236a78c528f7a17cc4ebae50cae4b05b1f4049e (diff)
Merging r155803:llvmorg-3.1.0-rc3
------------------------------------------------------------------------ r155803 | rsmith | 2012-04-29 17:16:51 -0700 (Sun, 29 Apr 2012) | 8 lines PR11926 + duplicates: Fix crash in -Wuninitialized when using a compiler like g++4.7, which reuses stack space allocated for temporaries. CFGElement::getAs returns a suitably-cast version of 'this'. Patch by Markus Trippelsdorf! No test: this code has the same observable behavior as the old code when built with most compilers, and the tests were already failing when built with a compiler for which this produced a broken binary. ------------------------------------------------------------------------ llvm-svn: 156394
-rw-r--r--clang/lib/Analysis/UninitializedValues.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Analysis/UninitializedValues.cpp b/clang/lib/Analysis/UninitializedValues.cpp
index 6e5da2525973..1c7e6b62f836 100644
--- a/clang/lib/Analysis/UninitializedValues.cpp
+++ b/clang/lib/Analysis/UninitializedValues.cpp
@@ -168,7 +168,8 @@ static const BinaryOperator *getLogicalOperatorInChain(const CFGBlock *block) {
if (block->empty())
return 0;
- const CFGStmt *cstmt = block->front().getAs<CFGStmt>();
+ CFGElement front = block->front();
+ const CFGStmt *cstmt = front.getAs<CFGStmt>();
if (!cstmt)
return 0;