summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Wodnicki <pawel@32bitmicro.com>2012-11-19 21:37:34 +0000
committerPawel Wodnicki <pawel@32bitmicro.com>2012-11-19 21:37:34 +0000
commitb1eb46af51631bf8de15a0532ee795884065bbfb (patch)
tree7987a5e94a337a8b4991f9e45ec866a11fed796d
parentb595a356285f677a8ee8b513c65aa1c852f9059e (diff)
downloadclang-b1eb46af51631bf8de15a0532ee795884065bbfb.tar.gz
clang-b1eb46af51631bf8de15a0532ee795884065bbfb.tar.bz2
clang-b1eb46af51631bf8de15a0532ee795884065bbfb.tar.xz
Merging r168124 into 3.2 release branch
Fix PR14321, a crash when Clang is built with GCC 4.7 at -O1 or greater. GCC 4.7 reuses stack slots fairly aggressively, which exposes more temporary lifetime bugs. No new test, this was caught by the existing CodeGenCXX/mangle-ms-templates.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168331 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/MicrosoftMangle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp
index 08dbfafe64..5d5b83d9a3 100644
--- a/lib/AST/MicrosoftMangle.cpp
+++ b/lib/AST/MicrosoftMangle.cpp
@@ -373,7 +373,7 @@ isTemplate(const NamedDecl *ND,
dyn_cast<ClassTemplateSpecializationDecl>(ND)) {
TypeSourceInfo *TSI = Spec->getTypeAsWritten();
if (TSI) {
- TemplateSpecializationTypeLoc &TSTL =
+ TemplateSpecializationTypeLoc TSTL =
cast<TemplateSpecializationTypeLoc>(TSI->getTypeLoc());
TemplateArgumentListInfo LI(TSTL.getLAngleLoc(), TSTL.getRAngleLoc());
for (unsigned i = 0, e = TSTL.getNumArgs(); i != e; ++i)