Issue |
134523
|
Summary |
Assertion `Ty->isPtrOrPtrVectorTy() && "This should only be called with a pointer or pointer vector type"' failed.
|
Labels |
new issue
|
Assignees |
|
Reporter |
gregbedwell
|
This is a new assertion failure showing up since https://github.com/llvm/llvm-project/commit/7d4ea771c481 (tag @nikic ).
I'm going to just include the C++-level reproducer as I'm not sure at which stage the bad behavior is being introduced, so this should allow the bug to be reproduced from any stage.
Here is the C++ test-case, reduced from a real project that we happen to build with the combination of thinlto and asan.
https://godbolt.org/z/feoYa9cET
```
struct h {
h();
int c;
};
struct array {
h b[12];
} d;
template <class af> array am(af j) { j(d); }
struct k {
k(char) {}
};
struct l {
l(array);
};
template <class bu> auto bv(bu j) {
auto a = [&]<class by>(by bz) -> l { return j(bz); };
am(a);
}
void ci();
void e();
void f();
void cj();
int b;
struct m {
template <class g> array n(g j, int) noexcept {
array c;
f();
ci();
e();
if (b)
cj();
j(0);
return c;
}
};
struct o {
static void p() {
m f;
auto g = [](k) {};
auto i = [&](auto) { return f.n(g, 2); };
bv(i);
}
};
int main() { o::p(); }
```
```
(py3.12) greg@GREG-WIN11:~/git/llvm-project/build$ ./bin/clang ~/reduce/1.cpp -O3 -g -flto -fexceptions -fsanitize=address -std=c++20 -fuse-ld=lld -w
ld.lld: /home/greg/git/llvm-project/llvm/lib/IR/DataLayout.cpp:755: unsigned int llvm::DataLayout::getIndexTypeSizeInBits(llvm::Type*) const: Assertion `Ty->isPtrOrPtrVectorTy() && "This should only be called with a pointer or pointer vector type"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs