https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/105648
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NagyDonat commented:
I read the commit once and I have a serious question about using
`getOriginRegion` in the invalidation logic (see inline comment for details).
Apart from that, the code LGTM (I might return later with a few additional
comments from a more through review,
@@ -313,7 +321,8 @@ std::optional printReferrer(const MemRegion
*Referrer) {
if (isa(Space))
return "global";
assert(isa(Space));
-return "stack";
+// This case covers top-level and inlined analyses.
+return "caller";
NagyDonat wrote:
@@ -393,6 +401,162 @@ ProgramStateRef
CStringChecker::checkNonNull(CheckerContext &C,
return stateNonNull;
}
+static std::optional getIndex(ProgramStateRef State,
+ const ElementRegion *ER, CharKind CK) {
+ SValBuilder &SVB = State->get
https://github.com/NagyDonat approved this pull request.
LGTM.
I'm a bit surprised to see that this checker duplicates the logic of the array
bounds checkers (in the special case when the indexing operation is within a
pointer subtraction). Right now this is OK but we'll need to delete this on
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/96501
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
NagyDonat wrote:
> These results look correct according to the checker, but I am not sure if
> such results are useful or really invalid:
> https://codechecker-demo.eastus.cloudapp.azure.com/Default/reports?run=vim_v8.2.1920_pointersub1&is-unique=on&diff-type=New&checker-name=alpha.core.Pointer
NagyDonat wrote:
> The warning message may be still misleading if the LHS or RHS "arrays" are
> non-array variables.
I think that the warning message is OK: "Subtraction of two pointers that do
not point into the same array is undefined behavior." -- this also covers the
case when one or both
https://github.com/NagyDonat approved this pull request.
The new changes also LGTM, feel free to merge this when you want.
https://github.com/llvm/llvm-project/pull/96295
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cg
https://github.com/NagyDonat commented:
I re-reviewed the commit and added two very minor remarks, otherwise LGTM.
https://github.com/llvm/llvm-project/pull/102602
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/m
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
@@ -327,6 +327,8 @@ Static Analyzer
New features
+- Now CSA models `builtin_*_overflow` functions.
NagyDonat wrote:
```suggestion
- Now CSA models `__builtin_*_overflow` functions.
```
https://github.com/llvm/llvm-project/pull/102602
___
@@ -16,21 +16,93 @@
#include "clang/Basic/Builtins.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
+#include "clang/StaticAnalyzer/Checkers/Taint.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
https://github.com/NagyDonat approved this pull request.
LGTM, feel free to merge this patch.
I'm glad that you implemented this; and sorry for this final review delay.
https://github.com/llvm/llvm-project/pull/106081
___
cfe-commits mailing list
cfe-
@@ -443,3 +443,33 @@ void test_unaligned_start_read(void) {
fclose(fp);
}
}
+
+void no_crash_if_count_is_negative(long s, unsigned char *buffer) {
+ FILE *fp = fopen("path", "r");
+ if (fp) {
+if (s * s == -1) {
NagyDonat wrote:
Nitpick: $s^2 = -1$
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/108393
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NagyDonat approved this pull request.
LGTM, thanks for catching this!
https://github.com/llvm/llvm-project/pull/108393
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit
https://github.com/NagyDonat commented:
I think this checker is definitely good enough to be moved out of `alpha`, but
I'm not sure that it should be placed in the `core` group, where we have a
strong requirement that "These checkers must be always switched on as other
checker rely on them.".
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/107596
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/107596
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -69,6 +69,7 @@ class CheckerContext {
/// the state of the program before the checker ran. Note, checkers should
/// not retain the node in their state since the nodes might get invalidated.
ExplodedNode *getPredecessor() { return Pred; }
+ const ProgramPoint getLocat
@@ -718,6 +718,91 @@ class NoStateChangeFuncVisitor : public BugReporterVisitor
{
PathSensitiveBugReport &R) final;
};
+/// Put a diagnostic on return statement of all inlined functions
+/// for which the region of interest \p RegionOfInter
@@ -538,7 +541,8 @@ ProgramStateRef CStringChecker::checkInit(CheckerContext &C,
OS << ") in the ";
printIdxWithOrdinalSuffix(OS, Buffer.ArgumentIndex + 1);
OS << " argument is undefined";
-emitUninitializedReadBug(C, State, Buffer.Expression, OS.str());
+em
https://github.com/NagyDonat commented:
I like this simplified variant, it's really straightforward now. I added a few
inline comments (mostly copied from #106982), but after that I'm satisfied with
the change.
https://github.com/llvm/llvm-project/pull/108373
__
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/108373
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -263,6 +263,23 @@ bool SVal::isZeroConstant() const {
// Pretty-Printing.
//===--===//
+StringRef SVal::getKindStr() const {
+ switch (getKind()) {
+#define BASIC_SVAL(Id, Parent)
https://github.com/NagyDonat commented:
The `static`ifying LGTM, my only concern is a seemingly unrelated `include`
change.
https://github.com/llvm/llvm-project/pull/108759
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/108759
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -12,6 +12,7 @@
//
//===--===//
+#include "Move.h"
NagyDonat wrote:
Why is this include added here?
https://github.com/llvm/llvm-project/pull/108759
__
https://github.com/NagyDonat updated
https://github.com/llvm/llvm-project/pull/106081
From 82e3d871766b132d0ce0b9e8e74371d8598d2431 Mon Sep 17 00:00:00 2001
From: Pavel Skripkin
Date: Tue, 6 Aug 2024 19:12:01 +0300
Subject: [PATCH 1/4] wip
---
.../Core/PathSensitive/DynamicExtent.h|
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/106081
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NagyDonat closed
https://github.com/llvm/llvm-project/pull/106081
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
NagyDonat wrote:
I merged the commit (after slightly clarifying the PR description / commit
message -- I hope you don't mind that).
https://github.com/llvm/llvm-project/pull/106081
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.
@@ -12,6 +12,7 @@
//
//===--===//
+#include "Move.h"
NagyDonat wrote:
Oh, I see -- thanks for the explanation!
https://github.com/llvm/llvm-project/pull/108759
_
https://github.com/NagyDonat approved this pull request.
https://github.com/llvm/llvm-project/pull/108759
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NagyDonat created
https://github.com/llvm/llvm-project/pull/108799
Add a FIXME testcase which documents less than ideal behavior of the analyzer
when a `const char *` is converted to `const unsigned char *`. This testcase is
motivated by an ArrayBoundV2 report produced on th
NagyDonat wrote:
This PR is primarily a "note to self", but it *is* NFC and ready to be merged
if we think that it'd be better to keep this reminder within the repository.
https://github.com/llvm/llvm-project/pull/108799
___
cfe-commits mailing list
c
https://github.com/NagyDonat approved this pull request.
The change looks good to me and as it is fairly innocent, I think we can merge
it soon (assuming that we don't get additional remarks from somebody else).
When you're merging this change please write a commit message that is
self-contain
NagyDonat wrote:
> sorry to bother, but seems like this pr is stalled for 2 weeks
I'm sorry that my comment delayed this PR -- next time when I write "wait a few
days", feel free to merge the ticket after a few days :smile:
https://github.com/llvm/llvm-project/pull/104599
@@ -212,6 +212,25 @@ typedef llvm::ImmutableMap
REGISTER_TRAIT_WITH_PROGRAMSTATE(PendingArrayDestruction,
PendingArrayDestructionMap)
+// This trait is used to heuristically filter out results produced from
+// execution paths that took "weak"
@@ -121,6 +121,34 @@ struct EvalCallOptions {
EvalCallOptions() {}
};
+/// Simple control flow statements like `if` can only produce a single two-way
+/// state split, so when the analyzer cannot determine the value of the
+/// condition, it can assume either of the two opti
@@ -3742,23 +3742,20 @@ void ExprEngine::evalLocation(ExplodedNodeSet &Dst,
BldrTop.addNodes(Tmp);
}
-std::pair
-ExprEngine::geteagerlyAssumeBinOpBifurcationTags() {
- static SimpleProgramPointTag
- eagerlyAssumeBinOpBifurcationTrue(TagProviderName,
-
@@ -3742,23 +3742,20 @@ void ExprEngine::evalLocation(ExplodedNodeSet &Dst,
BldrTop.addNodes(Tmp);
}
-std::pair
-ExprEngine::geteagerlyAssumeBinOpBifurcationTags() {
- static SimpleProgramPointTag
- eagerlyAssumeBinOpBifurcationTrue(TagProviderName,
-
@@ -583,11 +603,11 @@ class ExprEngine {
ExplodedNode *Pred,
ExplodedNodeSet &Dst);
- /// evalEagerlyAssumeBinOpBifurcation - Given the nodes in 'Src', eagerly
assume symbolic
- /// expressions of the form 'x
@@ -194,3 +199,99 @@ char test_comparison_with_extent_symbol(struct incomplete
*p) {
return ((char *)p)[-1]; // no-warning
}
+// WeakLoopAssumption suppression
+///
+
+int GlobalArray[100];
+int loop_suppre
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/112209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
NagyDonat wrote:
@steakhal I'm sorry that I disappeared for more than a week when you dropped
your alternative implementation. I thought a lot about the advantages and
limitations of my implementation, your implementation and even "third way"
alternatives (but unfortunately `check::BranchCondi
NagyDonat wrote:
By the way, my plans for the "how do we get an accurate iteration count?" and
the "how do we handle complex loop conditions that contain short-circuit
operators?" issues is that in this first patch I want to go with the rough
approximation that's easiest to implement, and I'll
https://github.com/NagyDonat updated
https://github.com/llvm/llvm-project/pull/112209
From ea6ab3fe84e5ac89f82def877c37c8409889d01d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Don=C3=A1t=20Nagy?=
Date: Mon, 14 Oct 2024 15:34:55 +0200
Subject: [PATCH 1/5] [analyzer][clang-tidy][NFC] Clean up eagerl
@@ -299,13 +299,12 @@ ANALYZER_OPTION(
ANALYZER_OPTION(
bool, ShouldEagerlyAssume, "eagerly-assume",
-"Whether we should eagerly assume evaluations of conditionals, thus, "
-"bifurcating the path. This indicates how the engine should handle "
-"expressions such
@@ -3767,28 +3764,26 @@ void
ExprEngine::evalEagerlyAssumeBinOpBifurcation(ExplodedNodeSet &Dst,
continue;
}
-ProgramStateRef state = Pred->getState();
-SVal V = state->getSVal(Ex, Pred->getLocationContext());
+ProgramStateRef State = Pred->getState();
+
@@ -314,6 +329,193 @@ getFuchsiaHandleSymbols(QualType QT, SVal Arg,
ProgramStateRef State) {
return {};
}
+FuchsiaHandleChecker::Note FuchsiaHandleChecker::createNote(
+SymbolRef Sym,
+std::function Message) const {
+ return [Sym, Message](BugReport &BR) -> std::s
@@ -0,0 +1,773 @@
+//===--- MutexModeling.cpp - Modeling of mutexes
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,126 @@
+//===--- MutexModelingDomain.h - Common vocabulary for modeling mutexes
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,169 @@
+//===--- MutexModelingGDM.h - Modeling of mutexes in GDM
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,773 @@
+//===--- MutexModeling.cpp - Modeling of mutexes
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,773 @@
+//===--- MutexModeling.cpp - Modeling of mutexes
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,139 @@
+//===--- MutexRegionExtractor.h - Modeling of mutexes
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -0,0 +1,773 @@
+//===--- MutexModeling.cpp - Modeling of mutexes
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/111381
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,139 @@
+//===--- MutexRegionExtractor.h - Modeling of mutexes
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
https://github.com/NagyDonat commented:
Nice well-designed code; I added several remarks, but they are all minor.
https://github.com/llvm/llvm-project/pull/111381
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/ma
https://github.com/NagyDonat approved this pull request.
LGTM. Let's not crash.
https://github.com/llvm/llvm-project/pull/111390
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -314,6 +449,127 @@ getFuchsiaHandleSymbols(QualType QT, SVal Arg,
ProgramStateRef State) {
return {};
}
+bool FuchsiaHandleChecker::needsInvalidate(const CallEvent &Call) const {
+ const FunctionDecl *FuncDecl =
dyn_cast_or_null(Call.getDecl());
+
+ assert(FuncDecl &&
@@ -127,26 +135,30 @@ class HandleState {
bool isEscaped() const { return K == Kind::Escaped; }
bool isUnowned() const { return K == Kind::Unowned; }
- static HandleState getMaybeAllocated(SymbolRef ErrorSym) {
-return HandleState(Kind::MaybeAllocated, ErrorSym);
+ s
@@ -336,141 +592,55 @@ void FuchsiaHandleChecker::checkPreCall(const CallEvent
&Call,
SmallVector Handles =
getFuchsiaHandleSymbols(PVD->getType(), Call.getArgSVal(Arg), State);
-// Handled in checkPostCall.
-if (hasFuchsiaAttr(PVD) ||
-hasFuchsiaA
@@ -267,12 +286,128 @@ class FuchsiaHandleSymbolVisitor final : public
SymbolVisitor {
private:
SmallVector Symbols;
};
+
+class FuchsiaBugVisitor final : public BugReporterVisitor {
+ // Handle that caused a problem.
+ SymbolRef Sym;
+
+ bool IsLeak;
+
+public:
+ Fuchsi
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/111588
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NagyDonat commented:
I read the patch and added my suggestions in inline comments, but I don't
promise that I found every little corner case.
Moreover, I'm strongly opposed to introducing a `BugReporterVisitor` instead of
directly creating the notes, because in this case you
@@ -99,6 +99,7 @@
#include "clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/Progr
@@ -314,6 +449,127 @@ getFuchsiaHandleSymbols(QualType QT, SVal Arg,
ProgramStateRef State) {
return {};
}
+bool FuchsiaHandleChecker::needsInvalidate(const CallEvent &Call) const {
+ const FunctionDecl *FuncDecl =
dyn_cast_or_null(Call.getDecl());
+
+ assert(FuncDecl &&
@@ -267,12 +286,128 @@ class FuchsiaHandleSymbolVisitor final : public
SymbolVisitor {
private:
SmallVector Symbols;
};
+
+class FuchsiaBugVisitor final : public BugReporterVisitor {
+ // Handle that caused a problem.
+ SymbolRef Sym;
+
+ bool IsLeak;
+
+public:
+ Fuchsi
@@ -267,12 +286,128 @@ class FuchsiaHandleSymbolVisitor final : public
SymbolVisitor {
private:
SmallVector Symbols;
};
+
+class FuchsiaBugVisitor final : public BugReporterVisitor {
+ // Handle that caused a problem.
+ SymbolRef Sym;
+
+ bool IsLeak;
+
+public:
+ Fuchsi
@@ -314,6 +449,127 @@ getFuchsiaHandleSymbols(QualType QT, SVal Arg,
ProgramStateRef State) {
return {};
}
+bool FuchsiaHandleChecker::needsInvalidate(const CallEvent &Call) const {
+ const FunctionDecl *FuncDecl =
dyn_cast_or_null(Call.getDecl());
+
+ assert(FuncDecl &&
NagyDonat wrote:
> I just saw it in various easy checkers like `ValistChecker`, so I thought
> it's "standard" way of reporting.
Yes, ValistChecker is another example where it's useless. By the way that's the
first checker that I wrote (not completely alone) when I was an intern many
years ag
NagyDonat wrote:
> > The change LGTM, I think we can merge it.
>
> I guess the testcase pointer-sub.c have to be fixed to work on the windows
> buildbot, also. Right?
Right, thanks for catching my mistake!
https://github.com/llvm/llvm-project/pull/111846
__
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/111846
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NagyDonat approved this pull request.
The change LGTM, I think we can merge it.
My only nitpick was that I tweaked the PR title to make it a bit more accurate.
(Feel free to tweak it further / discuss this if you disagree with my choice.)
https://github.com/llvm/llvm-project
@@ -212,6 +212,25 @@ typedef llvm::ImmutableMap
REGISTER_TRAIT_WITH_PROGRAMSTATE(PendingArrayDestruction,
PendingArrayDestructionMap)
+// This trait is used to heuristically filter out results produced from
+// execution paths that took "weak"
NagyDonat wrote:
@pskrgag Thanks for fixing this issue quickly! :smile:
https://github.com/llvm/llvm-project/pull/111253
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
NagyDonat wrote:
> I was thinking about using `check::Location` in this checker. The real
> problem is when the fixed address is used (to store or load), not if it is
> assigned to a pointer. (Or a fixed address becomes escaped.)
I agree that a checker that activates when a fixed address is _d
@@ -2808,27 +2825,63 @@ void ExprEngine::processBranch(const Stmt *Condition,
std::tie(StTrue, StFalse) = *KnownCondValueAssumption;
else {
assert(!isa(Condition));
+ // TODO: instead of this shortcut perhaps it would be better to "rejoin"
+ // the com
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/110458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -43,6 +43,12 @@ void FixedAddressChecker::checkPreStmt(const BinaryOperator
*B,
if (!T->isPointerType())
return;
+ // Omit warning if the RHS has already pointer type.
+ // The value may come from a variable and is candidate for a previous warning
+ // from the ch
https://github.com/NagyDonat approved this pull request.
Looks good to me, nice little improvement :)
I reworded a comment in an inline suggestion because I felt that it was a bit
difficult to understand; but feel free to change it further if you'd prefer.
https://github.com/llvm/llvm-project/
https://github.com/NagyDonat created
https://github.com/llvm/llvm-project/pull/110820
Remove the declaration of `ErrnoChecker::checkBranchCondition()` because this
method is not defined or used anywhere. (It's probably a leftover from some old
refactoring.)
From 72bc17b87a7955a58210dfe42d7d73
https://github.com/NagyDonat closed
https://github.com/llvm/llvm-project/pull/110820
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
NagyDonat wrote:
@steakhal May I merge this commit?
https://github.com/llvm/llvm-project/pull/112209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -299,13 +299,12 @@ ANALYZER_OPTION(
ANALYZER_OPTION(
bool, ShouldEagerlyAssume, "eagerly-assume",
-"Whether we should eagerly assume evaluations of conditionals, thus, "
-"bifurcating the path. This indicates how the engine should handle "
-"expressions such
https://github.com/NagyDonat closed
https://github.com/llvm/llvm-project/pull/112209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
NagyDonat wrote:
> > * I think it's likely (although not guaranteed) that this heuristic would
> > be helpful for other checkers as well, and if we want to activate it for
> > all checkers, then it must be done in an eager way (because eagerly sinking
> > lots of paths is significantly better
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/112209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -458,7 +458,6 @@ ClangTidyASTConsumerFactory::createASTConsumer(
if (!AnalyzerOptions.CheckersAndPackages.empty()) {
setStaticAnalyzerCheckerOpts(Context.getOptions(), AnalyzerOptions);
AnalyzerOptions.AnalysisDiagOpt = PD_NONE;
-AnalyzerOptions.eagerlyAssumeBi
https://github.com/NagyDonat approved this pull request.
LGTM. I already reviewed this together with the first step.
https://github.com/llvm/llvm-project/pull/112887
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin
https://github.com/NagyDonat approved this pull request.
LGTM, straightforward NFC improvement. Thanks for cleaning this up!
(Currently the diff is a bit confusing, because this cleanup builds on the
not-yet-merged commit https://github.com/llvm/llvm-project/pull/112887, but
that's just GUI aw
@@ -2866,12 +2877,14 @@ ConditionTruthVal
RangeConstraintManager::checkNull(ProgramStateRef State,
const llvm::APSInt *RangeConstraintManager::getSymVal(ProgramStateRef St,
SymbolRef Sym) const {
- const RangeSet *T = get
@@ -1485,6 +1487,18 @@ class SymbolicRangeInferrer
Sym->getType());
}
+ std::optional getRangeCommutativeSymSym(const SymSymExpr *SSE) {
+bool IsCommutative = llvm::is_contained({BO_Add, BO_Mul},
SSE->getOpcode());
+if (!IsCommutative)
+ return std::nu
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/112583
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NagyDonat approved this pull request.
LGTM overall, see inline remarks for details.
https://github.com/llvm/llvm-project/pull/112583
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listi
@@ -50,28 +50,17 @@ void test2() {
b = d;
a -= d;
+ clang_analyzer_warnIfReached(); // expected-warning {{REACHABLE}}
+
if (a != 0)
return;
- clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
-
- /* The BASELINE passes these checks ('wrning' is
501 - 600 of 1140 matches
Mail list logo