[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/83611 >From 8152ad56b320719553701edf020c30aea8c3213e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 1 Mar 2024 11:36:14 -0800 Subject: [PATCH 1/4] Fix null-deref thanks to an attribute on a global declarator

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Aaron Ballman via cfe-commits
@@ -734,6 +735,9 @@ class AttributePool { pool.Attrs.clear(); } + /// Take a list of attributes from another pool and add them to this pool. AaronBallman wrote: ```suggestion /// Removes the attributes from \c List, which are owned by \c Pool, and

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from a tiny commenting nit (take it or leave it). https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/83611 >From 8152ad56b320719553701edf020c30aea8c3213e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 1 Mar 2024 11:36:14 -0800 Subject: [PATCH 1/3] Fix null-deref thanks to an attribute on a global declarator

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
erichkeane wrote: > Note to self when I get back to work: Both done now! https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/83611 >From 8152ad56b320719553701edf020c30aea8c3213e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 1 Mar 2024 11:36:14 -0800 Subject: [PATCH 1/3] Fix null-deref thanks to an attribute on a global declarator

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/83611 >From 8152ad56b320719553701edf020c30aea8c3213e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 1 Mar 2024 11:36:14 -0800 Subject: [PATCH 1/3] Fix null-deref thanks to an attribute on a global declarator

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-02 Thread Erich Keane via cfe-commits
erichkeane wrote: Note to self when I get back to work: 1- Update commit message with bug #[ 83611](https://github.com/llvm/llvm-project/pull/83611) 2- Add bug # to release note. https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-02 Thread Erich Keane via cfe-commits
@@ -100,6 +100,12 @@ void AttributePool::takePool(AttributePool ) { pool.Attrs.clear(); } +void AttributePool::takeFrom(ParsedAttributesView , AttributePool ) { + assert( != this && "AttributePool can't take attributes from itself"); + llvm::for_each(List.AttrList,

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-01 Thread Shafik Yaghmour via cfe-commits
@@ -100,6 +100,12 @@ void AttributePool::takePool(AttributePool ) { pool.Attrs.clear(); } +void AttributePool::takeFrom(ParsedAttributesView , AttributePool ) { + assert( != this && "AttributePool can't take attributes from itself"); + llvm::for_each(List.AttrList,

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Note, I opened an issue for this here: https://github.com/llvm/llvm-project/issues/83385 https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/83611 >From 8152ad56b320719553701edf020c30aea8c3213e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 1 Mar 2024 11:36:14 -0800 Subject: [PATCH 1/2] Fix null-deref thanks to an attribute on a global declarator

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-01 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 601a9587a1a7eb8dd6377c4ab332edd3bce97a98 8152ad56b320719553701edf020c30aea8c3213e --

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Erich Keane (erichkeane) Changes This was reported (sort of) in a PR: #77703. The problem is that a declarator 'owns' an attributes allocation via an `AttributePool`. However, this example tries to copy a DeclaratorChunk from one

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/83611 This was reported (sort of) in a PR: #77703. The problem is that a declarator 'owns' an attributes allocation via an `AttributePool`. However, this example tries to copy a DeclaratorChunk from one Declarator