Open
Description
The best I could minimize is this, repro crashes on line 7 (*m_ptr = '\0'
):
class A
{
public:
A()
: m_ptr(m_buf)
{
*m_ptr = '\0';
}
private:
char m_buf[64] = {0};
char * m_ptr;
};
A a;
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 820403c.