[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread via cfe-commits
https://github.com/smanna12 created https://github.com/llvm/llvm-project/pull/94228 This patch adds an assert in getMangledNameImpl() to ensure that the expected attributes (TargetAttr, TargetVersionAttr, and TargetClonesAttr) are checked for NULL value before being used by appendAttributeMang

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: None (smanna12) Changes This patch adds an assert in getMangledNameImpl() to ensure that the expected attributes (TargetAttr, TargetVersionAttr, and TargetClonesAttr) are checked for NULL value before be

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff bba5ee47e63298d61f6ea441a140144ce370ba92 5459e49d79f0916b198446fe9a0c06e7f24f7f7d --

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread via cfe-commits
https://github.com/smanna12 edited https://github.com/llvm/llvm-project/pull/94228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread via cfe-commits
https://github.com/smanna12 edited https://github.com/llvm/llvm-project/pull/94228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/94228 >From 5459e49d79f0916b198446fe9a0c06e7f24f7f7d Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Fri, 31 May 2024 16:38:52 -0700 Subject: [PATCH 1/2] [Clang] Prevent null pointer dereference in target attribu

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. https://github.com/llvm/llvm-project/pull/94228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread Eli Friedman via cfe-commits
@@ -1853,18 +1853,26 @@ static std::string getMangledNameImpl(CodeGenModule &CGM, GlobalDecl GD, break; case MultiVersionKind::Target: { auto *Attr = FD->getAttr(); +assert(Attr && + "Expected TargetAttr to be present for attribute m

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited https://github.com/llvm/llvm-project/pull/94228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/94228 >From 5459e49d79f0916b198446fe9a0c06e7f24f7f7d Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Fri, 31 May 2024 16:38:52 -0700 Subject: [PATCH 1/3] [Clang] Prevent null pointer dereference in target attribu

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread via cfe-commits
@@ -1853,18 +1853,26 @@ static std::string getMangledNameImpl(CodeGenModule &CGM, GlobalDecl GD, break; case MultiVersionKind::Target: { auto *Attr = FD->getAttr(); +assert(Attr && + "Expected TargetAttr to be present for attribute m

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. https://github.com/llvm/llvm-project/pull/94228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

2024-06-03 Thread via cfe-commits
smanna12 wrote: Thank you @efriedma-quic for reviews! https://github.com/llvm/llvm-project/pull/94228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Prevent null pointer dereference in target attribute mangling (PR #94228)

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