[clang] [clang] Fix crash when compiling error with invalid decl (PR #77893)

2024-12-04 Thread Erich Keane via cfe-commits
@@ -40,7 +40,11 @@ static_assert( "Type is insufficiently aligned"); APValue::LValueBase::LValueBase(const ValueDecl *P, unsigned I, unsigned V) -: Ptr(P ? cast(P->getCanonicalDecl()) : nullptr), Local{I, V} {} +: Ptr(P ? cast(P->getCanonicalDecl()->isInvalidDecl()

[clang] [clang] Fix crash when compiling error with invalid decl (PR #77893)

2024-12-03 Thread Shafik Yaghmour via cfe-commits
@@ -40,7 +40,11 @@ static_assert( "Type is insufficiently aligned"); APValue::LValueBase::LValueBase(const ValueDecl *P, unsigned I, unsigned V) -: Ptr(P ? cast(P->getCanonicalDecl()) : nullptr), Local{I, V} {} +: Ptr(P ? cast(P->getCanonicalDecl()->isInvalidDecl()

[clang] [clang] Fix crash when compiling error with invalid decl (PR #77893)

2024-01-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qizhi Hu (jcsxky) Changes `APValue::LValueBase::LValueBase` constructs `ValueDecl` with its canonicalDecl, even though it's invalid. And when obtain its type, it also check all redecls and ignore checking if it's valid. This will cause cr

[clang] [clang] Fix crash when compiling error with invalid decl (PR #77893)

2024-01-12 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky created https://github.com/llvm/llvm-project/pull/77893 `APValue::LValueBase::LValueBase` constructs `ValueDecl` with its canonicalDecl, even though it's invalid. And when obtain its type, it also check all redecls and ignore checking if it's valid. This will cause cr