[LLVMbugs] [Bug 19681] New: crash on invalid in Sema::CheckAddressOfMemberAccess

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 7 11:25:43 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19681

            Bug ID: 19681
           Summary: crash on invalid in Sema::CheckAddressOfMemberAccess
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nlewycky at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Testcase:

struct TypoA {};
struct TypoB {
  void test();
private:
  template<typename T> void private_memfn(T);
};
void TypoB::test() {
  static_cast<void(TypoB::*)(int)>(&TypoA::private_memfn);
}

Program received signal SIGSEGV, Segmentation fault.
0x00000000012771ee in clang::RecordDecl::isAnonymousStructOrUnion (this=0x0) at
/usr/local/google/home/nlewycky/llvm/tools/clang/lib/Serialization/../../include/clang/AST/Decl.h:3097
warning: Source file is more recent than executable.
3097      bool isAnonymousStructOrUnion() const { return
AnonymousStructOrUnion; }
(gdb) bt
#0  0x00000000012771ee in clang::RecordDecl::isAnonymousStructOrUnion
(this=0x0) at
/usr/local/google/home/nlewycky/llvm/tools/clang/lib/Serialization/../../include/clang/AST/Decl.h:3097
#1  0x00000000015d18d4 in (anonymous
namespace)::AccessTarget::getEffectiveNamingClass (this=0x7fffffff7070) at
SemaAccess.cpp:224
#2  0x00000000015d47cf in IsAccessible (S=..., EC=..., Entity=...) at
SemaAccess.cpp:1316
#3  0x00000000015d4bc4 in CheckEffectiveAccess (S=..., EC=..., Loc=...,
Entity=...) at SemaAccess.cpp:1414
#4  0x00000000015d4da1 in CheckAccess (S=..., Loc=..., Entity=...) at
SemaAccess.cpp:1458
#5  0x00000000015d63ad in clang::Sema::CheckAddressOfMemberAccess
(this=0x6194be0, OvlExpr=0x61c87b8, Found=...) at SemaAccess.cpp:1785
#6  0x00000000018ddc19 in clang::Sema::ResolveAddressOfOverloadedFunction
(this=0x6194be0, AddressOfExpr=0x61c87b8, TargetType=..., Complain=true,
FoundResult=..., pHadMultipleCandidates=0x0) at SemaOverload.cpp:10000
#7  0x000000000182d260 in clang::Sema::PerformImplicitConversion
(this=0x6194be0, From=0x61c87b8, ToType=..., SCS=...,
Action=clang::Sema::AA_Casting, CCK=clang::Sema::CCK_OtherCast) at
SemaExprCXX.cpp:2747
#8  0x000000000182cbac in clang::Sema::PerformImplicitConversion
(this=0x6194be0, From=0x61c87b8, ToType=..., ICS=...,
Action=clang::Sema::AA_Casting, CCK=clang::Sema::CCK_OtherCast) at
SemaExprCXX.cpp:2623
#9  0x0000000001872418 in clang::InitializationSequence::Perform
(this=0x7fffffff87a0, S=..., Entity=..., Kind=..., Args=..., ResultType=0x0) at
SemaInit.cpp:5951
#10 0x00000000015e98b4 in TryStaticImplicitCast (Self=..., SrcExpr=...,
DestType=..., CCK=clang::Sema::CCK_OtherCast, OpRange=..., msg=@0x7fffffff9dec:
1750, Kind=@0x7fffffff9f24: clang::CK_Dependent, ListInitialization=false) at
SemaCast.cpp:1463
#11 0x00000000015e7d08 in TryStaticCast (Self=..., SrcExpr=..., DestType=...,
CCK=clang::Sema::CCK_OtherCast, OpRange=..., msg=@0x7fffffff9dec: 1750,
Kind=@0x7fffffff9f24: clang::CK_Dependent, BasePath=...,
ListInitialization=false) at SemaCast.cpp:955
#12 0x00000000015e78e4 in (anonymous namespace)::CastOperation::CheckStaticCast
(this=0x7fffffff9f00) at SemaCast.cpp:881
#13 0x00000000015e51ae in clang::Sema::BuildCXXNamedCast (this=0x6194be0,
OpLoc=..., Kind=clang::tok::kw_static_cast, DestTInfo=0x61ca270, E=0x61c87b8,
AngleBrackets=..., Parens=...) at SemaCast.cpp:295
#14 0x00000000015e4da4 in clang::Sema::ActOnCXXNamedCast (this=0x6194be0,
OpLoc=..., Kind=clang::tok::kw_static_cast, LAngleBracketLoc=..., D=...,
RAngleBracketLoc=..., LParenLoc=..., E=0x61c87b8, RParenLoc=...) at
SemaCast.cpp:235
#15 0x000000000155600e in clang::Parser::ParseCXXCasts (this=0x61b0110) at
ParseExprCXX.cpp:1257
#16 0x000000000154a9db in clang::Parser::ParseCastExpression (this=0x61b0110,
isUnaryExpression=false, isAddressOfOperand=false, NotCastExpr=@0x7fffffffb33f:
false, isTypeCast=clang::Parser::NotTypeCast) at ParseExpr.cpp:938
#17 0x00000000015494b8 in clang::Parser::ParseCastExpression (this=0x61b0110,
isUnaryExpression=false, isAddressOfOperand=false,
isTypeCast=clang::Parser::NotTypeCast) at ParseExpr.cpp:417
#18 0x000000000154859b in clang::Parser::ParseAssignmentExpression
(this=0x61b0110, isTypeCast=clang::Parser::NotTypeCast) at ParseExpr.cpp:169
#19 0x00000000015483c2 in clang::Parser::ParseExpression (this=0x61b0110,
isTypeCast=clang::Parser::NotTypeCast) at ParseExpr.cpp:121
#20 0x0000000001577d3d in clang::Parser::ParseExprStatement (this=0x61b0110) at
ParseStmt.cpp:381
#21 0x00000000015776c7 in
clang::Parser::ParseStatementOrDeclarationAfterAttributes (this=0x61b0110,
Stmts=..., OnlyStatement=false, TrailingElseLoc=0x0, Attrs=...) at
ParseStmt.cpp:234
#22 0x0000000001576f4e in clang::Parser::ParseStatementOrDeclaration
(this=0x61b0110, Stmts=..., OnlyStatement=false, TrailingElseLoc=0x0) at
ParseStmt.cpp:121
#23 0x0000000001579c45 in clang::Parser::ParseCompoundStatementBody
(this=0x61b0110, isStmtExpr=false) at ParseStmt.cpp:919
#24 0x000000000157fba4 in clang::Parser::ParseFunctionStatementBody
(this=0x61b0110, Decl=0x61c7c50, BodyScope=...) at ParseStmt.cpp:2484
#25 0x00000000015150ef in clang::Parser::ParseFunctionDefinition
(this=0x61b0110, D=..., TemplateInfo=..., LateParsedAttrs=0x7fffffffbe50) at
Parser.cpp:1096
#26 0x00000000015256ae in clang::Parser::ParseDeclGroup (this=0x61b0110,
DS=..., Context=0, AllowFunctionDefinitions=true, DeclEnd=0x0, FRI=0x0) at
ParseDecl.cpp:1571
#27 0x0000000001514357 in clang::Parser::ParseDeclOrFunctionDefInternal
(this=0x61b0110, attrs=..., DS=..., AS=clang::AS_none) at Parser.cpp:886
#28 0x000000000151443c in clang::Parser::ParseDeclarationOrFunctionDefinition
(this=0x61b0110, attrs=..., DS=0x0, AS=clang::AS_none) at Parser.cpp:902
#29 0x0000000001513b64 in clang::Parser::ParseExternalDeclaration
(this=0x61b0110, attrs=..., DS=0x0) at Parser.cpp:760
#30 0x000000000151301c in clang::Parser::ParseTopLevelDecl (this=0x61b0110,
Result=...) at Parser.cpp:557
#31 0x000000000150c48c in clang::ParseAST (S=..., PrintStats=false,
SkipFunctionBodies=false) at ParseAST.cpp:145
#32 0x00000000010140be in clang::ASTFrontendAction::ExecuteAction
(this=0x614d0e0) at FrontendAction.cpp:487
#33 0x0000000001013bf3 in clang::FrontendAction::Execute (this=0x614d0e0) at
FrontendAction.cpp:388
#34 0x0000000000fe1c9e in clang::CompilerInstance::ExecuteAction
(this=0x614c360, Act=...) at CompilerInstance.cpp:727
#35 0x0000000000fa8a66 in clang::ExecuteCompilerInvocation (Clang=0x614c360) at
ExecuteCompilerInvocation.cpp:239
#36 0x0000000000f9708d in cc1_main (ArgBegin=0x7fffffffdd48,
ArgEnd=0x7fffffffdd50, Argv0=0x7fffffffeb7e
"/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang",
MainAddr=0xfa214e <GetExecutablePath(char const*, bool)>) at cc1_main.cpp:112
#37 0x0000000000fa362f in main (argc_=3, argv_=0x7fffffffe908) at
driver.cpp:319

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140507/2f9c5e5c/attachment.html>


More information about the llvm-bugs mailing list