[llvm-bugs] [Bug 32318] New: -ast-dump-all crashes on empty files
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Mar 16 12:00:43 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=32318
Bug ID: 32318
Summary: -ast-dump-all crashes on empty files
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: aaron at aaronballman.com
CC: llvm-bugs at lists.llvm.org
If the file contains no declarations or lookups, then calling -ast-dump-all
asserts.
What's interesting is that a regular -ast-dump has content.
D:\llvm\build\Debug\bin>touch test.c
D:\llvm\build\Debug\bin>clang -cc1 -ast-dump test.c
TranslationUnitDecl 0x2225c9eead0 <<invalid sloc>> <invalid sloc>
|-TypedefDecl 0x2225c9ef020 <<invalid sloc>> <invalid sloc> implicit __int128_t
'__int128'
| `-BuiltinType 0x2225c9eed40 '__int128'
|-TypedefDecl 0x2225c9ef088 <<invalid sloc>> <invalid sloc> implicit
__uint128_t 'unsigned __int128'
| `-BuiltinType 0x2225c9eed60 'unsigned __int128'
|-TypedefDecl 0x2225c9ef378 <<invalid sloc>> <invalid sloc> implicit
__NSConstantString 'struct __NSConstantString_tag'
| `-RecordType 0x2225c9ef160 'struct __NSConstantString_tag'
| `-Record 0x2225c9ef0d8 '__NSConstantString_tag'
|-TypedefDecl 0x2225c9ef410 <<invalid sloc>> <invalid sloc> implicit
__builtin_ms_va_list 'char *'
| `-PointerType 0x2225c9ef3d0 'char *'
| `-BuiltinType 0x2225c9eeb60 'char'
`-TypedefDecl 0x2225c9ef478 <<invalid sloc>> <invalid sloc> implicit
__builtin_va_list 'char *'
`-PointerType 0x2225c9ef3d0 'char *'
`-BuiltinType 0x2225c9eeb60 'char'
D:\llvm\build\Debug\bin>clang -cc1 -ast-dump-all test.c
Assertion failed: (DumpDecls || DumpLookups) && "nothing to dump", file
D:\llvm\llvm\tools\clang\lib\Frontend\ASTConsumers.cpp, line 145
Wrote crash dump file
"C:\Users\aballman\AppData\Local\Temp\clang.exe-abbfb1.dmp"
#0 0x00007ff7a30d2f8c HandleAbort
d:\llvm\llvm\lib\support\windows\signals.inc:405:0
#1 0x00007ff93b431c81 (C:\Windows\SYSTEM32\ucrtbased.dll+0x81c81)
#2 0x00007ff93b4338a9 (C:\Windows\SYSTEM32\ucrtbased.dll+0x838a9)
#3 0x00007ff93b439495 (C:\Windows\SYSTEM32\ucrtbased.dll+0x89495)
#4 0x00007ff93b438ff7 (C:\Windows\SYSTEM32\ucrtbased.dll+0x88ff7)
#5 0x00007ff93b437061 (C:\Windows\SYSTEM32\ucrtbased.dll+0x87061)
#6 0x00007ff93b439a3f (C:\Windows\SYSTEM32\ucrtbased.dll+0x89a3f)
#7 0x00007ff7a40471d8 clang::CreateASTDumper(class
llvm::StringRef,bool,bool,bool)
d:\llvm\llvm\tools\clang\lib\frontend\astconsumers.cpp:145:0
#8 0x00007ff7a3fc19a2 clang::ASTDumpAction::CreateASTConsumer(class
clang::CompilerInstance &,class llvm::StringRef)
d:\llvm\llvm\tools\clang\lib\frontend\frontendactions.cpp:58:0
#9 0x00007ff7a3fb65c5 clang::FrontendAction::CreateWrappedASTConsumer(class
clang::CompilerInstance &,class llvm::StringRef)
d:\llvm\llvm\tools\clang\lib\frontend\frontendaction.cpp:143:0
#10 0x00007ff7a3fb7bad clang::FrontendAction::BeginSourceFile(class
clang::CompilerInstance &,class clang::FrontendInputFile const &)
d:\llvm\llvm\tools\clang\lib\frontend\frontendaction.cpp:387:0
#11 0x00007ff7a3f24aec clang::CompilerInstance::ExecuteAction(class
clang::FrontendAction &)
d:\llvm\llvm\tools\clang\lib\frontend\compilerinstance.cpp:949:0
#12 0x00007ff7a415e206 clang::ExecuteCompilerInvocation(class
clang::CompilerInstance *)
d:\llvm\llvm\tools\clang\lib\frontendtool\executecompilerinvocation.cpp:249:0
#13 0x00007ff7a0136194 cc1_main(class llvm::ArrayRef<char const *>,char const
*,void *) d:\llvm\llvm\tools\clang\tools\driver\cc1_main.cpp:221:0
#14 0x00007ff7a011a4dd ExecuteCC1Tool
d:\llvm\llvm\tools\clang\tools\driver\driver.cpp:299:0
#15 0x00007ff7a011ad8c main
d:\llvm\llvm\tools\clang\tools\driver\driver.cpp:380:0
#16 0x00007ff7a7bdf194 invoke_main
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:65:0
#17 0x00007ff7a7bdf057 __scrt_common_main_seh
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253:0
#18 0x00007ff7a7bdef1e __scrt_common_main
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:296:0
#19 0x00007ff7a7bdf1b9 mainCRTStartup
f:\dd\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0
#20 0x00007ff968d88364 (C:\Windows\System32\KERNEL32.DLL+0x8364)
#21 0x00007ff96b8570d1 (C:\Windows\SYSTEM32\ntdll.dll+0x670d1)
--
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/20170316/283645f5/attachment.html>
More information about the llvm-bugs
mailing list