[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-05-03 Thread via cfe-commits
AdvenamTacet wrote: It's not needed. https://github.com/llvm/llvm-project/pull/79522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

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

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-02-16 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka requested changes to this pull request. As we figured out what was the issue, this patch should not be needed https://github.com/llvm/llvm-project/pull/79522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

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

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

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

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-26 Thread via cfe-commits
AdvenamTacet wrote: > I think we need to understand the problem better. Agree as well, I changed PR to WIP. But I don't really know where to look now. > I think popping into a debugger would likely help here. @shafik What is the correct way of building a single test, so we have access to a

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-26 Thread via cfe-commits
https://github.com/AdvenamTacet converted_to_draft https://github.com/llvm/llvm-project/pull/79522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/79522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I believe the problem is that `DiagComparison` is capturing the locals `LHSValue` and `RHSValue` the lambda is being returned, the local are not longer in lifetime but we are calling `toString` on them. Maybe there is some SSO going on here that changes wh

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-26 Thread via cfe-commits
@@ -13288,9 +13288,23 @@ EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, // Reject differing bases from the normal codepath; we special-case // comparisons to null. if (!HasSameBase(LHSValue, RHSValue)) { - auto DiagComparison = [&] (

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-26 Thread Vitaly Buka via cfe-commits
@@ -13288,9 +13288,23 @@ EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, // Reject differing bases from the normal codepath; we special-case // comparisons to null. if (!HasSameBase(LHSValue, RHSValue)) { - auto DiagComparison = [&] (

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-26 Thread via cfe-commits
AdvenamTacet wrote: I rewrote all functions with turned off instrumentation (I removed `_LIBCPP_STRING_INTERNAL_MEMORY_ACCESS` completely) and I see no change in behavior. Error happens in the very same way with the very same shadow memory (and backtrace). I don't see where annotations can be

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-26 Thread via cfe-commits
AdvenamTacet wrote: @cor3ntin Thx for your comment! I looked at ternary operator at the very beginning, but discarded this direction as I was unable to create a small example reproducing the error. After your comment I started looking at it again. Your temporary fix also resolves the problem o

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-26 Thread via cfe-commits
https://github.com/cor3ntin requested changes to this pull request. We need to understand what's going on here. I suspect something gets tripped by the ternary. A temporary fix might be to assign ```cpp std::string first = Reversed ? RHS : LHS; std::string second = Reversed ? LHS : RHS; ```

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-25 Thread via cfe-commits
https://github.com/AdvenamTacet updated https://github.com/llvm/llvm-project/pull/79522 >From dc2538405e6b0f8ea19af23783afabfb4721ce0c Mon Sep 17 00:00:00 2001 From: Advenam Tacet Date: Thu, 25 Jan 2024 23:07:48 +0100 Subject: [PATCH 1/2] Extend life of variables in `DiagComparison` in `ExprCo

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-25 Thread via cfe-commits
https://github.com/AdvenamTacet updated https://github.com/llvm/llvm-project/pull/79522 >From dc2538405e6b0f8ea19af23783afabfb4721ce0c Mon Sep 17 00:00:00 2001 From: Advenam Tacet Date: Thu, 25 Jan 2024 23:07:48 +0100 Subject: [PATCH] Extend life of variables in `DiagComparison` in `ExprConsta

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-25 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 e8a5010c0338357c08c740de121b660aa933d5f4 804b9c1bf634585537306ac092508e7eb4e7ca60 --

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-25 Thread via cfe-commits
https://github.com/AdvenamTacet edited https://github.com/llvm/llvm-project/pull/79522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Tacet (AdvenamTacet) Changes This commit makes two variables static extending their life span. This patch is designed to address the issue of buildbots failing when AddressSanitizer's (ASan) short string annotations are enabled. It's esen

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-25 Thread via cfe-commits
https://github.com/AdvenamTacet created https://github.com/llvm/llvm-project/pull/79522 This commit makes two variables static extending their life span. This patch is designed to address the issue of buildbots failing when AddressSanitizer's (ASan) short string annotations are enabled. It's e