Issue |
147686
|
Summary |
clang-tidy 20 crashes in RegionStoreManager
|
Labels |
clang-tidy
|
Assignees |
|
Reporter |
BobIsOnFire
|
The best I could minimize is this, repro crashes on line 7 (`*m_ptr = '\0'`):
```cpp
class A
{
public:
A()
: m_ptr(m_buf)
{
*m_ptr = '\0';
}
private:
char m_buf[64] = {0};
char * m_ptr;
};
A a;
```
[crash.log](https://github.com/user-attachments/files/21140523/crash.log)
Reproduces in godbolt as well (with trunk clang-tidy): https://godbolt.org/z/PMaToWrWG
Using 20.1.7 compiled with assertions, I get following assertion error with the same stack:
```
clang-tidy: /export/home/nikita.akatiev/llvm-project/llvm/include/llvm/Support/Casting.h:566: decltype(auto) llvm::cast(const From&) [with To = clang::ento::nonloc::CompoundVal; From = clang::ento::SVal]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
```
I've also ran a git-bisect, which led me to this commit 820403c4e04db1f4adc8528bec33d393a5be3856. Somewhat surprisingly, `clang --analyze` doesn't seem to crash on this code.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs