[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-10 Thread Aaron Ballman via cfe-commits
@@ -4383,7 +4383,6 @@ static void handleAlignValueAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } void Sema::AddAlignValueAttr(Decl *D, const AttributeCommonInfo &CI, Expr *E) { - AlignValueAttr TmpAttr(Context, CI, E); AaronBallman wrote: I can fix those

[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-10 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/135013 >From 99190952174f334642ec237596969f9b0c846411 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 9 Apr 2025 09:51:49 -0400 Subject: [PATCH 1/3] Fix crash with align_value diagnostic reporting We were

[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-10 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/135013 We were passing the address of a local variable to a call to Diag() which then tried to use the object after its lifetime ended, resulting in crashes. We no longer pass the temporary object any longer. Fi

[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-09 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/135013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/135013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -4383,7 +4383,6 @@ static void handleAlignValueAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } void Sema::AddAlignValueAttr(Decl *D, const AttributeCommonInfo &CI, Expr *E) { - AlignValueAttr TmpAttr(Context, CI, E); erichkeane wrote: I think that is ac

[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-09 Thread Erich Keane via cfe-commits
@@ -4383,7 +4383,6 @@ static void handleAlignValueAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } void Sema::AddAlignValueAttr(Decl *D, const AttributeCommonInfo &CI, Expr *E) { - AlignValueAttr TmpAttr(Context, CI, E); erichkeane wrote: This attribute cre

[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-09 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/135013 >From 99190952174f334642ec237596969f9b0c846411 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 9 Apr 2025 09:51:49 -0400 Subject: [PATCH 1/2] Fix crash with align_value diagnostic reporting We were

[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) Changes We were passing the address of a local variable to a call to Diag() which then tried to use the object after its lifetime ended, resulting in crashes. We no longer pass the temporary object any longer.

[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-09 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 HEAD~1 HEAD --extensions cpp -- clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCXX/al

[clang] Fix crash with align_value diagnostic reporting (PR #135013)

2025-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Note, I filed an issue about the duplicate diagnostics at https://github.com/llvm/llvm-project/issues/135012 https://github.com/llvm/llvm-project/pull/135013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv