[llvm-bugs] [Bug 46484] New: Clang crash in clang/lib/Sema/SemaChecking.cpp:10028: static (anonymous namespace)::IntRange (anonymous namespace)::IntRange::forValueOfCanonicalType(clang::ASTContext &, const clang::Type *): Assertion `BT->isInteger()' failed.
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Jun 27 18:51:29 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=46484
Bug ID: 46484
Summary: Clang crash in clang/lib/Sema/SemaChecking.cpp:10028:
static (anonymous namespace)::IntRange (anonymous
namespace)::IntRange::forValueOfCanonicalType(clang::A
STContext &, const clang::Type *): Assertion
`BT->isInteger()' failed.
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: haoxintu at gmail.com
CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
richard-llvm at metafoo.co.uk
This code, bug.cc, reduced by C-Reduce, makes Clang crashed.
$cat bug.cc
int a long b = a = b ? throw 0 0
$clang++ bug.cc
bug.cc:1:6: error: expected ';' after top level declarator
int a long b = a = b ? throw 0 0
^
;
bug.cc:1:32: error: expected ':'
int a long b = a = b ? throw 0 0
^
:
bug.cc:1:22: note: to match this '?'
int a long b = a = b ? throw 0 0
^
bug.cc:1:20: warning: variable 'b' is uninitialized when used within its own
initialization [-Wuninitialized]
int a long b = a = b ? throw 0 0
~ ^
clang-11:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master-assert/clang/lib/Sema/SemaChecking.cpp:10028:
static (anonymous namespace)::IntRange (anonymous
namespace)::IntRange::forValueOfCanonicalType(clang::ASTContext &, const
clang::Type *): Assertion `BT->isInteger()' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name bug.cc -mrelocation-model static -mframe-pointer=all
-fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining
-debugger-tuning=gdb -resource-dir
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/lib/clang/11.0.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward
-internal-isystem /usr/local/include -internal-isystem
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/lib/clang/11.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/home/haoxin/compilers/new-scg/new-scg-build/map_test/clang-test/creduce
-ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions
-fcolor-diagnostics -faddrsig -o /tmp/bug-222437.o -x c++ bug.cc
1. <eof> parser at end of file
#0 0x00000000026e32c4 PrintStackTraceSignalHandler(void*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x26e32c4)
#1 0x00000000026e0eae llvm::sys::RunSignalHandlers()
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x26e0eae)
#2 0x00000000026e35e5 SignalHandler(int)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x26e35e5)
#3 0x00007faab0cef390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007faaaf859428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007faaaf85b02a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007faaaf851bd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
#7 0x00007faaaf851c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x0000000003f46dc0 (anonymous
namespace)::IntRange::forValueOfType(clang::ASTContext&, clang::QualType)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3f46dc0)
#9 0x0000000003f45fb7 GetExprRange(clang::ASTContext&, clang::Expr const*,
unsigned int, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3f45fb7)
#10 0x0000000003f45e1d GetExprRange(clang::ASTContext&, clang::Expr const*,
unsigned int, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3f45e1d)
#11 0x0000000003f46143 GetExprRange(clang::ASTContext&, clang::Expr const*,
unsigned int, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3f46143)
#12 0x0000000003f3fa4d CheckImplicitConversion(clang::Sema&, clang::Expr*,
clang::QualType, clang::SourceLocation, bool*, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3f3fa4d)
#13 0x0000000003f31ccf AnalyzeImplicitConversions(clang::Sema&, clang::Expr*,
clang::SourceLocation, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3f31ccf)
#14 0x0000000003f33340 clang::Sema::CheckCompletedExpr(clang::Expr*,
clang::SourceLocation, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3f33340)
#15 0x0000000004282285 clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x4282285)
#16 0x00000000040227f5 clang::Sema::AddInitializerToDecl(clang::Decl*,
clang::Expr*, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x40227f5)
#17 0x0000000003df2f38
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3df2f38)
#18 0x0000000003df081e clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3df081e)
#19 0x0000000003dd4f2c
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3dd4f2c)
#20 0x0000000003dd49c5
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3dd49c5)
#21 0x0000000003dd37f3
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3dd37f3)
#22 0x0000000003dd183d
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3dd183d)
#23 0x0000000003dccb6d clang::ParseAST(clang::Sema&, bool, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x3dccb6d)
#24 0x0000000002ea0873 clang::FrontendAction::Execute()
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x2ea0873)
#25 0x0000000002e3b0c3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x2e3b0c3)
#26 0x0000000002f4a672
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x2f4a672)
#27 0x0000000000956798 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x956798)
#28 0x0000000000954cac ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x954cac)
#29 0x0000000000954958 main
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x954958)
#30 0x00007faaaf844830 __libc_start_main
/build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:325:0
#31 0x00000000009519a9 _start
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin/clang-11+0x9519a9)
clang-11: error: unable to execute command: Aborted (core dumped)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin
clang-11: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-11: note: diagnostic msg: /tmp/bug-92fecd.cpp
clang-11: note: diagnostic msg: /tmp/bug-92fecd.sh
clang-11: note: diagnostic msg:
********************
$clang++ --version
clang version 11.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-master/build/bin
--
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/20200628/39c223e9/attachment-0001.html>
More information about the llvm-bugs
mailing list