[clang] 25b9696 - [analyzer] Upstream BitwiseShiftChecker

2023-08-18 Thread Donát Nagy via cfe-commits
Author: Donát Nagy Date: 2023-08-18T10:47:05+02:00 New Revision: 25b9696b61e53a958e217bb3d0eab66350dc187f URL: https://github.com/llvm/llvm-project/commit/25b9696b61e53a958e217bb3d0eab66350dc187f DIFF: https://github.com/llvm/llvm-project/commit/25b9696b61e53a958e217bb3d0eab66350dc187f.diff LO

[clang] 3e01403 - [analyzer] Improve underflow handling in ArrayBoundV2

2023-08-21 Thread Donát Nagy via cfe-commits
Author: Donát Nagy Date: 2023-08-21T17:17:02+02:00 New Revision: 3e014038b373e5a4a96d89d46cea17e4d2456a04 URL: https://github.com/llvm/llvm-project/commit/3e014038b373e5a4a96d89d46cea17e4d2456a04 DIFF: https://github.com/llvm/llvm-project/commit/3e014038b373e5a4a96d89d46cea17e4d2456a04.diff LO

[clang] 8a5cfdf - [analyzer][NFC] Remove useless class BuiltinBug

2023-08-28 Thread Donát Nagy via cfe-commits
Author: Donát Nagy Date: 2023-08-28T15:20:14+02:00 New Revision: 8a5cfdf7851dcdb4e16c510b133d7d0e79e43fc4 URL: https://github.com/llvm/llvm-project/commit/8a5cfdf7851dcdb4e16c510b133d7d0e79e43fc4 DIFF: https://github.com/llvm/llvm-project/commit/8a5cfdf7851dcdb4e16c510b133d7d0e79e43fc4.diff LO

[clang] cec30e2 - [dataflow] Fix complie on gcc7 part 2

2023-06-30 Thread Donát Nagy via cfe-commits
Author: Donát Nagy Date: 2023-06-30T16:27:36+02:00 New Revision: cec30e2b190bd58a26f54b5fd4232d3828632466 URL: https://github.com/llvm/llvm-project/commit/cec30e2b190bd58a26f54b5fd4232d3828632466 DIFF: https://github.com/llvm/llvm-project/commit/cec30e2b190bd58a26f54b5fd4232d3828632466.diff LO

[clang] 1d75b18 - [analyzer][NFC] Fix dangling StringRef in barely used code

2023-06-30 Thread Donát Nagy via cfe-commits
Author: Donát Nagy Date: 2023-06-30T17:15:43+02:00 New Revision: 1d75b18843fbca52655e240a120b5fdeeef17c0e URL: https://github.com/llvm/llvm-project/commit/1d75b18843fbca52655e240a120b5fdeeef17c0e DIFF: https://github.com/llvm/llvm-project/commit/1d75b18843fbca52655e240a120b5fdeeef17c0e.diff LO

[clang] de25473 - [analyzer] Fix comparison logic in ArrayBoundCheckerV2

2023-04-26 Thread Donát Nagy via cfe-commits
Author: Donát Nagy Date: 2023-04-26T15:02:23+02:00 New Revision: de2547329b41ad6ea4ea876d12731bde5a6b64c5 URL: https://github.com/llvm/llvm-project/commit/de2547329b41ad6ea4ea876d12731bde5a6b64c5 DIFF: https://github.com/llvm/llvm-project/commit/de2547329b41ad6ea4ea876d12731bde5a6b64c5.diff LO

[clang] 8c22cbe - [analyzer] ArrayBoundCheckerV2: suppress false positives from ctype macros

2023-05-03 Thread Donát Nagy via cfe-commits
Author: Donát Nagy Date: 2023-05-03T18:52:27+02:00 New Revision: 8c22cbea87beb74da3dc5891c40cdf574cd5fe56 URL: https://github.com/llvm/llvm-project/commit/8c22cbea87beb74da3dc5891c40cdf574cd5fe56 DIFF: https://github.com/llvm/llvm-project/commit/8c22cbea87beb74da3dc5891c40cdf574cd5fe56.diff LO

[clang] b88023c - [analyzer][NFC] Use std::optional instead of custom "empty" state

2023-05-04 Thread Donát Nagy via cfe-commits
Author: Donát Nagy Date: 2023-05-04T12:56:15+02:00 New Revision: b88023c25729f4dd4548a25e5e12d6624e2adbaf URL: https://github.com/llvm/llvm-project/commit/b88023c25729f4dd4548a25e5e12d6624e2adbaf DIFF: https://github.com/llvm/llvm-project/commit/b88023c25729f4dd4548a25e5e12d6624e2adbaf.diff LO

[clang] b16a593 - [analyzer][NFC] Pass the diagnostic message to the TrackConstraintBRVisitor

2023-06-06 Thread Donát Nagy via cfe-commits
Author: Endre Fulop Date: 2023-06-06T16:28:31+02:00 New Revision: b16a59328fc5120006aeac501637229cc7e30357 URL: https://github.com/llvm/llvm-project/commit/b16a59328fc5120006aeac501637229cc7e30357 DIFF: https://github.com/llvm/llvm-project/commit/b16a59328fc5120006aeac501637229cc7e30357.diff L

[clang] [analyzer] Fix crash in Stream checker when using void pointers (PR #97199)

2024-07-01 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat requested changes to this pull request. Unfortunately this PR is not a full solution, because e.g. the following test code still triggers the crash (if it is appended to the test file `stream.c`): ```c struct zerosized { int foo[0]; }; void fread_zerosized(struc

[clang] [clang][analyzer] Improve PointerSubChecker (PR #96501)

2024-07-01 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > Even protobuf contains this type of code: > https://codechecker-demo.eastus.cloudapp.azure.com/Default/report-detail?run=protobuf_v3.13.0_pointersub1&is-unique=on&diff-type=New&checker-name=alpha.core.PointerSub&report-id=5545776&report-hash=1bcd310fbaeccbcc13645b9b277239a2&re

[clang] [analyzer] Fix crash in Stream checker when using void pointers (PR #97199)

2024-07-01 Thread Donát Nagy via cfe-commits
NagyDonat wrote: _I only noticed that this PR was already merged after posting the review. There is no need to revert the commit -- it's better than nothing -- but I'd be happy if you created a followup change that also handles the testcase that I mentioned._ https://github.com/llvm/llvm-proj

[clang] [clang][analyzer] MmapWriteExecChecker improvements (PR #97078)

2024-07-01 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM, straightforward change. Thanks! https://github.com/llvm/llvm-project/pull/97078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang][analyzer] MmapWriteExecChecker improvements (PR #97078)

2024-07-01 Thread Donát Nagy via cfe-commits
@@ -21,30 +21,55 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/Checker

[clang] [clang][analyzer] MmapWriteExecChecker improvements (PR #97078)

2024-07-01 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/97078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reland "[analyzer][NFC] Reorganize Z3 report refutation" (PR #97265)

2024-07-01 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Let's merge this again, after the Z3 version there shouldn't be any additional problems. https://github.com/llvm/llvm-project/pull/97265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] Reland "[analyzer][NFC] Reorganize Z3 report refutation" (PR #97265)

2024-07-01 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/97265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] MmapWriteExecChecker improvements (PR #97078)

2024-07-01 Thread Donát Nagy via cfe-commits
@@ -21,30 +21,55 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/Checker

[clang] [clang][analyzer] MmapWriteExecChecker improvements (PR #97078)

2024-07-01 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/97078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[analyzer] Harden safeguards for Z3 query times" (PR #97298)

2024-07-01 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. This should be re-landed as well; when it was merged earlier the only issue was the incompatibility with old Z3 and that was addressed since then (by bumping the version requirement). https://github.com/llvm/llvm-project/pull/97298 _

[clang] [analyzer] Fix crash in Stream checker when using void pointers (PR #97199)

2024-07-01 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Thanks for the updates! I added few minor comments, but the PR is already good enough to be merged. > > I only noticed that this PR was already merged after posting the review. > > There is no need to revert the commit -- it's better th

[clang] [analyzer] Fix crash in Stream checker when using void pointers (PR #97199)

2024-07-01 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/97199 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix crash in Stream checker when using void pointers (PR #97199)

2024-07-01 Thread Donát Nagy via cfe-commits
@@ -1034,16 +1034,16 @@ void StreamChecker::preWrite(const FnDescription *Desc, const CallEvent &Call, C.addTransition(State); } -static std::optional getPointeeType(const MemRegion *R) { +static QualType getPointeeType(const MemRegion *R) { if (!R) -return std::null

[clang] [analyzer] Fix crash in Stream checker when using void pointers (PR #97199)

2024-07-01 Thread Donát Nagy via cfe-commits
@@ -1034,16 +1034,16 @@ void StreamChecker::preWrite(const FnDescription *Desc, const CallEvent &Call, C.addTransition(State); } -static std::optional getPointeeType(const MemRegion *R) { +static QualType getPointeeType(const MemRegion *R) { if (!R) -return std::null

[clang] [clang][analyzer][doc] Migrate user-related docs from HTML to RST (PR #97034)

2024-07-02 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,37 @@ +Obtaining the Static Analyzer += + +This page describes how to download and install the analyzer. Once the analyzer is installed, follow the asdf :doc:`CommandLineUsage` on using the commandline to get started analyzing your code. --

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-07-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/95550 From 06adc063c2388ea534537f5a417751fdf64b22cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Fri, 14 Jun 2024 15:16:34 +0200 Subject: [PATCH 1/4] [clang-tidy] Clarify diagnostics of bugpron

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-07-02 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I mentioned this change in the paragraph that was describing my earlier commit (that was also modifying this check). https://github.com/llvm/llvm-project/pull/95550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-07-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/95550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer][doc] Migrate checkers-related docs from HTML to RST (PR #97032)

2024-07-02 Thread Donát Nagy via cfe-commits
NagyDonat wrote: :thinking: Deleting the html files could break some links on external sites, so I think it would be better to replace them with a very simple "This content was moved to " placeholder. https://github.com/llvm/llvm-project/pull/97032 _

[clang] [clang][analyzer][doc] Migrate user-related docs from HTML to RST (PR #97034)

2024-07-02 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,238 @@ +Command-Line Usage: CodeChecker and scan-build +=== + +This document provides guidelines for running Clang Static Analyzer from the command line on whole projects. +CodeChecker and scan-build are two CLI tools for usi

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-07-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM, with the disclaimer that I'd still prefer e.g. "second argument instead of "2nd argument" -- but I won't block the review with this bikeshedding. https://github.com/llvm/llvm-project/pull/95408 __

[clang] [clang][analyzer][doc] Migrate user-related docs from HTML to RST (PR #97034)

2024-07-02 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,238 @@ +Command-Line Usage: CodeChecker and scan-build +=== + +This document provides guidelines for running Clang Static Analyzer from the command line on whole projects. +CodeChecker and scan-build are two CLI tools for usi

[clang] [clang][analyzer][doc] Migrate user-related docs from HTML to RST (PR #97034)

2024-07-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I'm really happy to see that this duplicated documentation is finally cleaned up after so many years :partying_face: I added a few minor remarks in inline comments, but the change looks good overall. As we discussed privately, this change should be (mos

[clang] [clang][analyzer][doc] Migrate user-related docs from HTML to RST (PR #97034)

2024-07-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/97034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer][doc] Migrate user-related docs from HTML to RST (PR #97034)

2024-07-02 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,239 @@ +Command Line Usage: scan-build and CodeChecker +== + +This document provides guidelines for running Clang Static Analyzer from the command line on whole projects. +CodeChecker and scan-build are two CLI tools for usin

[clang] [clang][analyzer][doc] Migrate user-related docs from HTML to RST (PR #97034)

2024-07-02 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,239 @@ +Command Line Usage: scan-build and CodeChecker +== + +This document provides guidelines for running Clang Static Analyzer from the command line on whole projects. +CodeChecker and scan-build are two CLI tools for usin

[clang] [clang][analyzer][doc] Migrate user-related docs from HTML to RST (PR #97034)

2024-07-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/97034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I'm really happy that you decided to document these :smile: https://github.com/llvm/llvm-project/pull/97407 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-02 Thread Donát Nagy via cfe-commits
@@ -346,6 +352,39 @@ class CompoundVal : public NonLoc { static bool classof(SVal V) { return V.getKind() == CompoundValKind; } }; +/// The simplest example of a concrete compound value is nonloc::CompoundVal, +/// which represents a concrete r-value of an initializer-list o

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/97407 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-02 Thread Donát Nagy via cfe-commits
@@ -346,6 +352,39 @@ class CompoundVal : public NonLoc { static bool classof(SVal V) { return V.getKind() == CompoundValKind; } }; +/// The simplest example of a concrete compound value is nonloc::CompoundVal, +/// which represents a concrete r-value of an initializer-list o

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-02 Thread Donát Nagy via cfe-commits
@@ -346,6 +352,39 @@ class CompoundVal : public NonLoc { static bool classof(SVal V) { return V.getKind() == CompoundValKind; } }; +/// The simplest example of a concrete compound value is nonloc::CompoundVal, +/// which represents a concrete r-value of an initializer-list o

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-03 Thread Donát Nagy via cfe-commits
@@ -346,6 +352,39 @@ class CompoundVal : public NonLoc { static bool classof(SVal V) { return V.getKind() == CompoundValKind; } }; +/// The simplest example of a concrete compound value is nonloc::CompoundVal, +/// which represents a concrete r-value of an initializer-list o

[clang] [analyzer][NFC] Add some docs for LazyCompoundValue (PR #97407)

2024-07-03 Thread Donát Nagy via cfe-commits
@@ -346,6 +352,39 @@ class CompoundVal : public NonLoc { static bool classof(SVal V) { return V.getKind() == CompoundValKind; } }; +/// The simplest example of a concrete compound value is nonloc::CompoundVal, +/// which represents a concrete r-value of an initializer-list o

[clang] [analyzer] [MallocChecker] suspect all release functions as candidate for suppression (PR #104599)

2024-09-04 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. I'm satisfied with the current state of this commit, but let's wait a few days for a review from @Szelethus (or anybody else interested). https://github.com/llvm/llvm-project/pull/104599 ___ cfe

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat requested changes to this pull request. Unfortunately I found several fundamental issues within the implementation of `extractActualValueFrom()` -- see inline comments for details. Moreover I'm not convinced that this "replace `LazyCompoundVal`s with actual values"

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
@@ -490,6 +491,47 @@ SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, llvm_unreachable("Unexpected unary operator"); } +namespace { +/// Iterate through to store to find the actual value this LazyCompoundVal +/// corresponds to. Further readin

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
@@ -490,6 +491,47 @@ SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, llvm_unreachable("Unexpected unary operator"); } +namespace { +/// Iterate through to store to find the actual value this LazyCompoundVal +/// corresponds to. Further readin

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
@@ -490,6 +491,47 @@ SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, llvm_unreachable("Unexpected unary operator"); } +namespace { +/// Iterate through to store to find the actual value this LazyCompoundVal +/// corresponds to. Further readin

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
@@ -490,6 +491,47 @@ SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, llvm_unreachable("Unexpected unary operator"); } +namespace { +/// Iterate through to store to find the actual value this LazyCompoundVal +/// corresponds to. Further readin

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
@@ -490,6 +491,47 @@ SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, llvm_unreachable("Unexpected unary operator"); } +namespace { +/// Iterate through to store to find the actual value this LazyCompoundVal +/// corresponds to. Further readin

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Prevent crash due to missing EventDispatch in corner case (PR #107294)

2024-09-05 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I investigated this situation and I found that this crash is not limited to empty source files -- I'd guess that the analyzer would crash on any input if it's executed as ``` // RUN: %clang_analyze_cc1 -w -analyzer-checker=nullability \ // RUN:

[clang] [analyzer] Prevent crash due to missing EventDispatch in corner case (PR #107294)

2024-09-05 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_analyze_cc1 -w -analyzer-checker=nullability \ +// RUN: -analyzer-output=text -verify %s +// +// expected-no-diagnostics +// +// This case previously crashed because of an assert in CheckerManager.cpp, +// checking for registe

[clang] [analyzer] Prevent crash due to missing EventDispatch in corner case (PR #107294)

2024-09-05 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/107294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Prevent crash due to missing EventDispatch in corner case (PR #107294)

2024-09-05 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Hmm, I see that this assertion was hidden behind an `#ifndef NDEBUG` so it is only active within debug builds of the analyzer. Nevertheless, I still think that it's better to remove it, because 1. it does not offer significant protection against introduci

[clang] [analyzer] Prevent crash due to missing EventDispatch in corner case (PR #107294)

2024-09-05 Thread Donát Nagy via cfe-commits
@@ -48,15 +48,7 @@ bool CheckerManager::hasPathSensitiveCheckers() const { EvalCallCheckers, EndOfTranslationUnitCheckers); } -void CheckerManager::finishedCheckerRegistration() { -#ifndef NDEBUG - // Make sure that for every event that has listeners, there is at least

[clang] [analyzer] Remove overzealous "No dispatcher registered" assertion (PR #107294)

2024-09-05 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/107294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Remove overzealous "No dispatcher registered" assertion (PR #107294)

2024-09-05 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/107294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Remove overzealous "No dispatcher registered" assertion (PR #107294)

2024-09-05 Thread Donát Nagy via cfe-commits
NagyDonat wrote: @vabridgers I rewrote the title and description of this PR to describe the current approach. Feel free to adjust (or partially restore) it if you'd prefer a different phrasing. https://github.com/llvm/llvm-project/pull/107294 ___ cfe

[clang] [analyzer] Model constructor initializer for an array member (PR #107537)

2024-09-06 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > LGTM. FYI "modelled" should contain only 1 "l" if I'm not mistaken. British English uses "modeled", while American uses "modelled". I don't know which is preferred in LLVM. https://github.com/llvm/llvm-project/pull/107537 ___ cfe-

[clang] [analyzer] Remove overzealous "No dispatcher registered" assertion (PR #107294)

2024-09-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Looks good to me :) https://github.com/llvm/llvm-project/pull/107294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix #embed crash (PR #107764)

2024-09-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: LGTM, there is no reason to crash on `#embed`. I think it would be nice to have a few testcases that show the behavior of the analyzer around `#embed`: - Can we produce bug reports if there is an (unrelated) `#embed` expression on the execution path? Or

[clang] [analyzer] fix crash on binding to symbolic region with `void *` type (PR #107572)

2024-09-09 Thread Donát Nagy via cfe-commits
NagyDonat wrote: To me this solution seems to be a bit hacky -- I don't like that we need to scatter "handle `void *` as if it was `char *`" special cases in various parts of the analyzer (I vaguely recall that I have also seen similar hacks elsewhere). I'd prefer solutions that are as generi

[clang] [analyzer] Improve handling of unsigned values in ArrayBoundCheckerV2 (PR #81034)

2024-09-09 Thread Donát Nagy via cfe-commits
NagyDonat wrote: These reports are definitely FPs caused by buggy number handling, so it would be good to suppress them. I was planning to rewrite both `alpha.security.ReturnPtrRange` and `alpha.unix.cstring.OutOfBounds` to rely on the "backend" prototyped within ArrayBoundV2 instead of the c

[clang] [analyzer] fix crash on binding to symbolic region with `void *` type (PR #107572)

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

[clang] [analyzer] fix crash on binding to symbolic region with `void *` type (PR #107572)

2024-09-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Bikeshedding: let's delete that empty line. Otherwise LGTM. https://github.com/llvm/llvm-project/pull/107572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [analyzer] fix crash on binding to symbolic region with `void *` type (PR #107572)

2024-09-09 Thread Donát Nagy via cfe-commits
@@ -3,6 +3,9 @@ int clang_analyzer_eval(int); NagyDonat wrote: ```suggestion ``` https://github.com/llvm/llvm-project/pull/107572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [clang][analyzer] Remove array bounds check from PointerSubChecker (PR #102580)

2024-08-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: In the PR/commit message you write that > At least theoretically the array bounds checker (when finalized) should find > the same cases that were detected by the PointerSubChecker. but I'm pretty sure that the array bound checker already does find all th

[clang] [clang][analyzer] Remove array bounds check from PointerSubChecker (PR #102580)

2024-08-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Remove array bounds check from PointerSubChecker (PR #102580)

2024-08-09 Thread Donát Nagy via cfe-commits
@@ -2501,7 +2501,14 @@ alpha.core.PointerSub (C) Check for pointer subtractions on two pointers pointing to different memory chunks. According to the C standard §6.5.6 only subtraction of pointers that point into (or one past the end) the same array object is valid (for this -p

[clang] [clang][analyzer] Remove array bounds check from PointerSubChecker (PR #102580)

2024-08-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Remove array bounds check from PointerSubChecker (PR #102580)

2024-08-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add more notes to PointerSubChecker (PR #102432)

2024-08-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat requested changes to this pull request. Thanks! We should close this when that other PR is accepted and merged. Until then I'm putting a "Request changes" mark on this to prevent an accidental merge. https://github.com/llvm/llvm-project/pull/102432

[clang] [clang][analyzer] Remove array bounds check from PointerSubChecker (PR #102580)

2024-08-09 Thread Donát Nagy via cfe-commits
NagyDonat wrote: Oh, you're right, invalid pointer arithmetic like `(&x - 1)` is not handled by ArrayBoundV2, because right now that's the responsibility of a THIRD checker, `alpha.core.PointerArithm`. However, directly after bringing `ArrayBoundV2` out of alpha, I'll continue with working on

[clang] [clang] [Static analyzer]: add initial support for builtin overflow (PR #102602)

2024-08-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Thanks for adding support for these functions! The code LGTM overall, except for one mostly theoretical issue (about the use of `assert`) which I described in an inline comment. https://github.com/llvm/llvm-project/pull/102602 ___

[clang] [clang] [Static analyzer]: add initial support for builtin overflow (PR #102602)

2024-08-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [Static analyzer]: add initial support for builtin overflow (PR #102602)

2024-08-09 Thread Donát Nagy via cfe-commits
@@ -21,16 +21,67 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/Checker

[clang] [clang] [Static analyzer]: add initial support for builtin overflow (PR #102602)

2024-08-09 Thread Donát Nagy via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [clang] [Static analyzer]: add initial support for builtin overflow (PR #102602)

2024-08-09 Thread Donát Nagy via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [clang] [Static analyzer]: add initial support for builtin overflow (PR #102602)

2024-08-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Remove array bounds check from PointerSubChecker (PR #102580)

2024-08-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Thanks for the updates, I'm satisfied with the state of this commit. However let's wait for an independent approval from @steakhal @haoNoQ or someone else, because this change does reduce the scope of this checker. https://github.com/llv

[clang] [clang][ASTImporter] New fix for default template parameter values. (PR #101836)

2024-08-09 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. This change seems to be correct, but I don't know enough to dig into the details and provide a confident review. However, I as far as I know there are no significantly better reviewers, so I can give you the formal approval. I think you

[clang] [analyzer][NFC] Trivial refactoring of region invalidation (PR #102456)

2024-08-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/102456 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Donát Nagy via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Improve documentation of `invalidateRegion` methods (PR #102477)

2024-08-12 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > Do you plan to apply more refactors to invalidation and Store? These were opportunistic unplanned refactors, I was just familiarizing myself with the invalidation logic (because I'll need to use it in loop widening), and I quickly fixed some minor issues that I spotted. How

[clang] [analyzer][NFC] Improve documentation of `invalidateRegion` methods (PR #102477)

2024-08-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/102477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Donát Nagy via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-13 Thread Donát Nagy via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/103059 ...because it is too noisy to be useful right now, and its architecture is terrible, so it can't act a starting point of future development. The main problem with this checker is that it tries to do (or at le

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-14 Thread Donát Nagy via cfe-commits
@@ -1039,10 +1039,6 @@ def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">, HelpText<"Warn about buffer overflows (newer checker)">, Documentation; -def MallocOverflowSecurityChecker : Checker<"MallocOverflow">, NagyDonat wrote: Is it possible to write a "t

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/103059 From 36821708145587553f13df8648920f281b318240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Tue, 13 Aug 2024 14:50:17 +0200 Subject: [PATCH 1/2] [analyzer] Delete alpha.security.MallocOver

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-14 Thread Donát Nagy via cfe-commits
@@ -1,40 +0,0 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -analyzer-checker=alpha.security.MallocOverflow,unix -verify %s -// RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -analyzer-checker=alpha.security.MallocOverflow,unix,optin.portability -DPORTAB

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/103059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [analyzer] Delete `alpha.security.MallocOverflow` (PR #103059)

2024-08-14 Thread Donát Nagy via cfe-commits
@@ -1039,10 +1039,6 @@ def ArrayBoundCheckerV2 : Checker<"ArrayBoundV2">, HelpText<"Warn about buffer overflows (newer checker)">, Documentation; -def MallocOverflowSecurityChecker : Checker<"MallocOverflow">, NagyDonat wrote: Now that I think about it, w

  1   2   3   4   5   6   7   8   9   10   >