diff options
author | vabridgers <58314289+vabridgers@users.noreply.github.com> | 2023-09-20 05:06:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-20 05:06:45 -0500 |
commit | 1c05651426297c773334943b9e8875bcc67b5db3 (patch) | |
tree | 756f5777026c64c6b400be53067b94595cda17dd /llvm/lib/IR/Function.cpp | |
parent | 3d422c46828387770be07547d335a71719901979 (diff) | |
download | llvm-1c05651426297c773334943b9e8875bcc67b5db3.zip llvm-1c05651426297c773334943b9e8875bcc67b5db3.tar.gz llvm-1c05651426297c773334943b9e8875bcc67b5db3.tar.bz2 |
[clang] [C23] Fix crash with _BitInt running clang-tidy (#65889)
This crash was exposed recently in our randomized testing. _BitInts were
not being handled properly during IntegerLiteral visitation. This patch
addresses the problem for now.
The BitIntType has no getKind() method, so the FoldingSetID is taken
from the APInt value representing the _BitInt(), similar to other
methods in StmtProfile.cpp.
Crash seen (summary form):
clang-tidy: <src-root>/llvm/include/llvm/Support/Casting.h:566:
decltype(auto) llvm::cast(const From&) [with To = clang::BuiltinType;
From = clang::QualType]: Assertion `isa<To>(Val) && "cast<Ty>() argument
of incompatible type!"' failed
```
#9 <address> decltype(auto) llvm::cast<clang::BuiltinType,
clang::QualType>(clang::QualType const&)
<src-root>/llvm/include/llvm/Support/Casting.h:566:3
#10 <address> clang::BuiltinType const* clang::Type::castAs<clang::BuiltinType>() const
<bin-root>/tools/clang/include/clang/AST/TypeNodes.inc:86:1
#11 <address> (anonymous namespace)::StmtProfiler::VisitIntegerLiteral(
clang::IntegerLiteral const*)
<src-root>/clang/lib/AST/StmtProfile.cpp:1362:64
#12 <address> clang::StmtVisitorBase<llvm::make_const_ptr,
(anonymous namespace)::StmtProfiler, void>::Visit(clang::Stmt const*)
<src-root>/clang/include/clang/AST/StmtNodes.inc:1225:1
```
Reviewed By: donat.nagy
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
0 files changed, 0 insertions, 0 deletions