[clang] Unknown array lvalue element (PR #133381)

2025-04-05 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/133381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,146 @@ +//===- LValueElementTest.cpp ---===// steakhal wrote: I agree, we should see if we can properly test this in the list tests, as you proposed already. https://github.com/llvm/llvm-project/pull/133381 ___

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/133381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal deleted https://github.com/llvm/llvm-project/pull/133381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Balazs Benics via cfe-commits
@@ -511,13 +511,9 @@ SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, // Only allow non-integer offsets if the base region has no offset itself. // FIXME: This is a somewhat arbitrary restriction. We should be using // SValBuilder here to add the

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/133381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,146 @@ +//===- LValueElementTest.cpp ---===// steakhal wrote: +1 https://github.com/llvm/llvm-project/pull/133381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: LGTM, thanks. https://github.com/llvm/llvm-project/pull/133381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/133381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,146 @@ +//===- LValueElementTest.cpp ---===// NagyDonat wrote: I feel that creating a full unittest is overkill for this job, and it would be much more concise to specify these testcases as a lit test that uses `debug.

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Donát Nagy via cfe-commits
@@ -39,14 +39,9 @@ int assumingBothPointerToMiddle(int arg) { // will speak about the "byte offset" measured from the beginning of the TenElements. int *p = TenElements + 2; int a = p[arg]; - // FIXME: The following note does not appear: - // {{Assuming byte offset is

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I'm really happy to see a fix for this weakness of the static analyzer, and overall I'm satisfied with the commit, but I didn't have time to think about the implications of this change (and picking the right representation: nested `ElementRegion`s vs a s

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread Donát Nagy via cfe-commits
@@ -511,13 +511,9 @@ SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, // Only allow non-integer offsets if the base region has no offset itself. // FIXME: This is a somewhat arbitrary restriction. We should be using // SValBuilder here to add the

[clang] Unknown array lvalue element (PR #133381)

2025-03-28 Thread via cfe-commits
https://github.com/T-Gruber updated https://github.com/llvm/llvm-project/pull/133381 >From 241c95a956a440b9a118654baad55fb253d2413c Mon Sep 17 00:00:00 2001 From: T-Gruber Date: Fri, 28 Mar 2025 07:37:59 +0100 Subject: [PATCH 1/5] Remove early return for UnknownVal --- clang/lib/StaticAnalyze

[clang] Unknown array lvalue element (PR #133381)

2025-03-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (T-Gruber) Changes Remove the early return for BaseRegions of type ElementRegion. Return meaningful MemRegionVal for these cases as well. Previous discussion: https://discourse.llvm.org/t/lvalueelement-returns-unknownval-for-multi-d

[clang] Unknown array lvalue element (PR #133381)

2025-03-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: None (T-Gruber) Changes Remove the early return for BaseRegions of type ElementRegion. Return meaningful MemRegionVal for these cases as well. Previous discussion: https://discourse.llvm.org/t/lvalueelement-returns-unkn

[clang] Unknown array lvalue element (PR #133381)

2025-03-27 Thread via cfe-commits
https://github.com/T-Gruber created https://github.com/llvm/llvm-project/pull/133381 Remove the early return for BaseRegions of type ElementRegion. Return meaningful MemRegionVal for these cases as well. Previous discussion: https://discourse.llvm.org/t/lvalueelement-returns-unknownval-for-mu