[LLVMbugs] [Bug 11926] Clang segfaults during bootstrap (warning related?)
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Apr 28 03:36:09 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=11926
Markus Trippelsdorf <markus at trippelsdorf.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|WORKSFORME |
--- Comment #17 from Markus Trippelsdorf <markus at trippelsdorf.de> 2012-04-28 05:36:09 CDT ---
According to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53147
const CFGStmt *cstmt = block->front().getAs<CFGStmt>();
block->front() returns a temp variable which ends its life after the statement
ends.
The following patch fixes this me:
diff --git a/clang/lib/Analysis/UninitializedValues.cpp
b/clang/lib/Analysis/UninitializedValues.cpp
index 6e5da25..ae3030a 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 bf = block->front();
+ const CFGStmt *cstmt = bf.getAs<CFGStmt>();
if (!cstmt)
return 0;
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list