r220841 - Don't capture DeclRefExpr::getNameInfo().getInfo(). It returns reference in temporary object.
NAKAMURA Takumi
geek4civic at gmail.com
Wed Oct 29 01:11:48 PDT 2014
Author: chapuni
Date: Wed Oct 29 03:11:47 2014
New Revision: 220841
URL: http://llvm.org/viewvc/llvm-project?rev=220841&view=rev
Log:
Don't capture DeclRefExpr::getNameInfo().getInfo(). It returns reference in temporary object.
DeclarationNameInfo::getInfo() returns reference, but DeclRefExpr::getNameInfo() returns temporary DeclarationNameInfo().
It triggered a local crash for me.
Failing Tests (1):
Clang :: SemaTemplate/instantiate-overload-candidates.cpp
Assertion failed!
Program: bin\clang.EXE
File: clang/lib/Basic/SourceManager.cpp, Line 822
Expression: 0 && "Invalid SLocOffset or bad function choice"
Modified:
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=220841&r1=220840&r2=220841&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Wed Oct 29 03:11:47 2014
@@ -10460,7 +10460,7 @@ TreeTransform<Derived>::RebuildCXXOperat
SourceLocation RBrace;
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Callee)) {
- DeclarationNameLoc &NameLoc = DRE->getNameInfo().getInfo();
+ DeclarationNameLoc NameLoc = DRE->getNameInfo().getInfo();
LBrace = SourceLocation::getFromRawEncoding(
NameLoc.CXXOperatorName.BeginOpNameLoc);
RBrace = SourceLocation::getFromRawEncoding(
More information about the cfe-commits
mailing list