[LLVMbugs] [Bug 16939] New: Crash during CodeGen for DebugInfo with __uuidof in template argument

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 20 00:16:25 PDT 2013


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

            Bug ID: 16939
           Summary: Crash during CodeGen for DebugInfo with __uuidof in
                    template argument
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:
struct __declspec(uuid("{12345678-1234-1234-1234-1234567890aB}")) uuid;

template <const struct _GUID *>
struct thing {
};

thing<&__uuidof(uuid)> y;

run with:
./llvm/build/bin/clang -cc1 -x c++ testcase.cpp -fms-extensions -cxx-abi
microsoft -S -o - -g

gives us:
UNREACHABLE executed at
./llvm/src/tools/clang/lib/CodeGen/CGDebugInfo.cpp:1297!
0  clang           0x0000000001b8dbee llvm::sys::PrintStackTrace(_IO_FILE*) +
46
1  clang           0x0000000001b8deab
2  clang           0x0000000001b8e11e
3  libpthread.so.0 0x00007f0ba81cecb0
4  libc.so.6       0x00007f0ba740d425 gsignal + 53
5  libc.so.6       0x00007f0ba7410b8b abort + 379
6  clang           0x0000000001b4bbf6
7  clang           0x0000000001be1b50
clang::CodeGen::CGDebugInfo::CollectTemplateParams(clang::TemplateParameterList
const*, llvm::ArrayRef<clang::TemplateArgument>, llvm::DIFile) + 3344
8  clang           0x0000000001be1cbe
clang::CodeGen::CGDebugInfo::CollectCXXTemplateParams(clang::ClassTemplateSpecializationDecl
const*, llvm::DIFile) + 190
9  clang           0x0000000001be6506
clang::CodeGen::CGDebugInfo::CreateLimitedType(clang::RecordType const*) + 2374
10 clang           0x0000000001bdd743
clang::CodeGen::CGDebugInfo::getOrCreateLimitedType(clang::RecordType const*,
llvm::DIFile) + 147
11 clang           0x0000000001be24b9
clang::CodeGen::CGDebugInfo::CreateType(clang::RecordType const*, bool) + 297
12 clang           0x0000000001be58ab
clang::CodeGen::CGDebugInfo::CreateTypeNode(clang::QualType, llvm::DIFile,
bool) + 715
13 clang           0x0000000001bda65a
clang::CodeGen::CGDebugInfo::getOrCreateType(clang::QualType, llvm::DIFile,
bool) + 442
14 clang           0x0000000001bebe70
clang::CodeGen::CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable*,
clang::VarDecl const*) + 960
15 clang           0x0000000001c5318c
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*) +
2092
16 clang           0x0000000001c4fcdf
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 575
17 clang           0x0000000001c51b8c
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 764
18 clang           0x0000000001c53f54
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 356
19 clang           0x0000000001bd3be4
20 clang           0x0000000001bd1e28
21 clang           0x000000000202ec9c clang::ParseAST(clang::Sema&, bool, bool)
+ 524
22 clang           0x0000000001ef8209 clang::ASTFrontendAction::ExecuteAction()
+ 345
23 clang           0x0000000001bd116e clang::CodeGenAction::ExecuteAction() +
1246
24 clang           0x0000000001ef7d2f clang::FrontendAction::Execute() + 191
25 clang           0x0000000001ecb740
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 800
26 clang           0x0000000001b95088
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1048
27 clang           0x000000000082cc4a cc1_main(char const**, char const**, char
const*, void*) + 698
28 clang           0x0000000000825a42 main + 578
29 libc.so.6       0x00007f0ba73f876d __libc_start_main + 237

It would seem that CGDebugInfo::CollectTemplateParams believes that it should
never get a TemplateArgument::Expression and yet, it's getting one.

I'm not entirely surprised that it is upset that it didn't care for
CXXUuidofExpr, it's pretty magical compared to most expressions wrt template
arguments.

-- 
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/20130820/43630c3b/attachment.html>


More information about the llvm-bugs mailing list