[clang] [Clang] Guard against null in template instantiation process (PR #97913)

2024-07-15 Thread via cfe-commits
https://github.com/smanna12 closed https://github.com/llvm/llvm-project/pull/97913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Guard against null in template instantiation process (PR #97913)

2024-07-15 Thread via cfe-commits
@@ -636,6 +636,9 @@ bool Sema::SetupConstraintScope( ? FD->getInstantiatedFromMemberFunction() : FD->getInstantiatedFromDecl(); +if (!InstantiatedFrom) + return true; + smanna12 wrote: Thank you @zyn0217 for the reviews and cl

[clang] [Clang] Guard against null in template instantiation process (PR #97913)

2024-07-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 requested changes to this pull request. https://github.com/llvm/llvm-project/pull/97913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Guard against null in template instantiation process (PR #97913)

2024-07-06 Thread Younan Zhang via cfe-commits
@@ -636,6 +636,9 @@ bool Sema::SetupConstraintScope( ? FD->getInstantiatedFromMemberFunction() : FD->getInstantiatedFromDecl(); +if (!InstantiatedFrom) + return true; + zyn0217 wrote: This is unnecessary. For both `TK_MemberSp

[clang] [Clang] Guard against null in template instantiation process (PR #97913)

2024-07-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/97913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Guard against null in template instantiation process (PR #97913)

2024-07-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (smanna12) Changes This patch adds a null check for InstantiatedFrom to prevent dereferencing a null pointer during the template instantiation process in clang::Sema::SetupConstraintScope(). The fix ensures that the function exits e

[clang] [Clang] Guard against null in template instantiation process (PR #97913)

2024-07-06 Thread via cfe-commits
https://github.com/smanna12 created https://github.com/llvm/llvm-project/pull/97913 This patch adds a null check for InstantiatedFrom to prevent dereferencing a null pointer during the template instantiation process in clang::Sema::SetupConstraintScope(). The fix ensures that the function exi