NoQ added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:84
@@ +83,3 @@
+// Can E value be greater or equal than Val?
+static bool canBeGreaterEqual(CheckerContext &C, const Expr *E,
+ unsigned long long Val) {
-
NoQ updated this revision to Diff 43683.
NoQ marked an inline comment as done.
NoQ added a comment.
An attempt on the .def-files.
The next step would probably be the `VisitChildren()` thing, and I'll see if it
allows to refactor and simplify some code.
__
Forgot to answer: I guess there ar
NoQ added inline comments.
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def:31
@@ +30,3 @@
+// is both instantiated and derived from.
+// Additionally, its kind is not its name with "Kind" suffix,
+// unlike all other regions.
zaks.anna wrot
NoQ created this revision.
NoQ added reviewers: zaks.anna, dcoughlin.
NoQ added a subscriber: cfe-commits.
Based on discussion in D15448.
- For every sub-class `C`, its kind in the relevant enumeration is `CKind` (or
`C##Kind` in preprocessor-ish terms), eg:
`MemRegionKind` -> `MemRegionValKin
NoQ updated this revision to Diff 44475.
NoQ marked 5 inline comments as done.
NoQ added a comment.
Renamed the kinds for consistency (review http://reviews.llvm.org/D16062), this
diff is updated to use the new naming convention. The 'kind' column gets
removed from the def-files.
http://review
NoQ updated this revision to Diff 44628.
NoQ marked 2 inline comments as done.
NoQ added a comment.
Good point! Removed the friend-class directive here, and also in
`NonStaticGlobalSpaceRegion`, which is also abstract.
Agreed and renamed text regions to code regions.
http://reviews.llvm.org/D1
NoQ updated this revision to Diff 44629.
NoQ added a comment.
Another rebase on top of http://reviews.llvm.org/D16062.
http://reviews.llvm.org/D15448
Files:
docs/analyzer/DebugChecks.rst
include/clang/StaticAnalyzer/Checkers/SValExplainer.h
include/clang/StaticAnalyzer/Core/PathSensitive/
NoQ updated this revision to Diff 44734.
NoQ added a comment.
Rebase on top of http://reviews.llvm.org/D12901 - support `SymbolCast` in the
explainer, as it finally appears in the wild.
http://reviews.llvm.org/D15448
Files:
docs/analyzer/DebugChecks.rst
include/clang/StaticAnalyzer/Checker
NoQ added a comment.
Nope, will commit without `SymbolCast` support for now, encountered some issues
with http://reviews.llvm.org/D12901 that would probably be worth a separate
commit.
http://reviews.llvm.org/D15448
___
cfe-commits mailing list
cf
Author: dergachev
Date: Wed Jan 13 07:49:29 2016
New Revision: 257598
URL: http://llvm.org/viewvc/llvm-project?rev=257598&view=rev
Log:
[analyzer] Fix SVal/SymExpr/MemRegion class and enum names for consistency.
The purpose of these changes is to simplify introduction of definition files
for the
Author: dergachev
Date: Wed Jan 13 09:13:48 2016
New Revision: 257605
URL: http://llvm.org/viewvc/llvm-project?rev=257605&view=rev
Log:
[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion.
Provide separate visitor templates for the three hierarchies, and also
the `FullSValVisito
Author: dergachev
Date: Wed Jan 13 09:52:25 2016
New Revision: 257608
URL: http://llvm.org/viewvc/llvm-project?rev=257608&view=rev
Log:
Revert "[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion."
This reverts commit r257605.
The test fails on architectures that use unsigned i
NoQ removed rL LLVM as the repository for this revision.
NoQ updated this revision to Diff 44758.
NoQ added a comment.
Reverted the patch due to a few issues. This revision should fix these issues.
The explain-svals test is fixed to target a specific target, in order to make
sure that the defini
NoQ added a reviewer: rsmith.
NoQ added a comment.
Richard: excuse me, adding you because you are an expert on the `modulemap`,
could you have a quick look at the proposed changes here and probably point me
in the right direction, because i'm not quite sure how to test the
modules-enabled build
NoQ created this revision.
NoQ added reviewers: pgousseau, zaks.anna, dcoughlin, xazax.hun.
NoQ added a subscriber: cfe-commits.
Sorry for being a bit slow, i should have had a look at the review earlier; i
noticed some stuff after the recent patch by Pierre Gousseau was committed.
1. There's an
NoQ added a comment.
Managed to reproduce the build error with `-fmodules` on my machine.
Committed the updated patch as r257893, the buildbot seems happy.
I hope this review is actually closed now :)
http://reviews.llvm.org/D15448
___
cfe-commits m
Author: dergachev
Date: Fri Jan 15 09:22:05 2016
New Revision: 257893
URL: http://llvm.org/viewvc/llvm-project?rev=257893&view=rev
Log:
[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion, v2.
Provide separate visitor templates for the three hierarchies, and also
the `FullSValVi
Author: dergachev
Date: Mon Jan 18 04:17:16 2016
New Revision: 258039
URL: http://llvm.org/viewvc/llvm-project?rev=258039&view=rev
Log:
[analyzer] Fix an off-by-one in evalIntegralCast()
Make sure that we do not add SymbolCast at the very boundary of
the range in which the cast would not certainl
NoQ added a subscriber: NoQ.
NoQ added a comment.
Hmm. If we want to catch bugs resulting from alternative `strcmp()`
implementations, then probably a test case that demonstrates the improvement
would be worth it, eg.:
int x = strcmp("foo", "bar"));
if (x == 1 || x == -1)
clang_analyzer
NoQ added a subscriber: NoQ.
NoQ added a comment.
In http://reviews.llvm.org/D13126#291763, @danielmarjamaki wrote:
> I have problems with the "default" handling of expressions.
>
> I want to warn about loss of precision for such code:
>
> unsigned int x = 256;
> unsigned char c;
> c = x;
>
NoQ added a subscriber: NoQ.
NoQ added a comment.
Wow, useful stuff!
There's a little problem with the `shouldNotCrash()` test: the first warning on
`invokeF()` on line 107 generates a sink, and the rest of the function never
gets executed. It's probably a good idea to split it into three separ
Hmm. I once thought about creating a 'checkBeginAnalysis()' callback to
match 'checkEndAnalysis()'; this one's more powerful, and matches
'checkEndFunction()' in a similar manner.
At a glance, I wonder if it's worth it to provide a CheckerContext
inside this callback and then handle transition
NoQ added a subscriber: NoQ.
NoQ added a comment.
Yeah, that's what i had in mind. Additionally, `Decl` can be obtained as
`Context.getStackFrame().getDecl()` (and in fact the `getStackFrame()` thing
itself is of interest as well), so there's no need to pass it as an extra
argument. On the othe
NoQ added a comment.
In http://reviews.llvm.org/D12726#303122, @zaks.anna wrote:
> > So the real question is whether (or rather how) the Store should maintain
> > correct region liveness information
>
> > after completing its internal garbage collection pass, because there are,
> > in fact, o
Author: dergachev
Date: Thu Dec 10 03:28:06 2015
New Revision: 255236
URL: http://llvm.org/viewvc/llvm-project?rev=255236&view=rev
Log:
[analyzer] Fix symbolic element index lifetime.
SymbolReaper was destroying the symbol too early when it was referenced only
from an index SVal of a live Element
NoQ created this revision.
NoQ added reviewers: zaks.anna, dcoughlin, xazax.hun.
NoQ added a subscriber: cfe-commits.
It seems that in several places in the code Clang Static Analyzer tries to
recursively traverse the `SVal` hierarchy, so i made a visitor for `SVal`,
`SymExpr`, and `MemRegion` h
NoQ added a comment.
Good point, will try to make a .def file.
There's a tiny inconsistency with `SVal` naming that would most likely need to
be fixed in this approach:
nonloc::SymbolVal => SymbolValKind
loc::MemRegionVal => MemRegionKind // no "Val"!
Hmm, maybe make a .def file for symbol
NoQ added a comment.
I've got a few minor code comments.
I really wish to have a look at false positives on which
> the value analysis fails and then there is not much my checker could do
either in a form of FIXME tests, or as preprocessed code samples, because i'm
currently digging the topic
NoQ added a comment.
Hmm, just noticed the related work on casts in http://reviews.llvm.org/D12901,
which seems to be directly related to my hand-waving above. It might
accidentally be useful for reducing FPs of this checker as well.
http://reviews.llvm.org/D13126
__
https://github.com/haoNoQ approved this pull request.
https://github.com/llvm/llvm-project/pull/81532
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -282,8 +282,8 @@ isInUnspecifiedPointerContext(internal::Matcher
InnerMatcher) {
//(i.e., computing the distance between two pointers); or ...
auto CallArgMatcher =
- callExpr(forEachArgumentWithParam(InnerMatcher,
- hasPointerType() /* array
https://github.com/haoNoQ approved this pull request.
https://github.com/llvm/llvm-project/pull/80358
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/81400
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/81532
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
haoNoQ wrote:
Ok this needs a rebase after the other two PRs landed.
https://github.com/llvm/llvm-project/pull/81580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/81580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/81808
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ commented:
LGTM! Just one nitpick.
https://github.com/llvm/llvm-project/pull/81808
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -222,4 +223,210 @@ bool isPtrConversion(const FunctionDecl *F) {
return false;
}
+bool isSingleton(const FunctionDecl *F) {
+ assert(F);
+ // FIXME: check # of params == 1
+ if (auto *MethodDecl = dyn_cast(F)) {
+if (!MethodDecl->isStatic())
+ return false;
+
@@ -222,4 +223,210 @@ bool isPtrConversion(const FunctionDecl *F) {
return false;
}
+bool isSingleton(const FunctionDecl *F) {
+ assert(F);
+ // FIXME: check # of params == 1
+ if (auto *MethodDecl = dyn_cast(F)) {
+if (!MethodDecl->isStatic())
+ return false;
+
@@ -598,16 +623,16 @@ class ArraySubscriptGadget : public WarningGadget {
}
static Matcher matcher() {
-// FIXME: What if the index is integer literal 0? Should this be
-// a safe gadget in this case?
- // clang-format off
+// clang-format off
retur
https://github.com/haoNoQ approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/80504
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -406,6 +406,39 @@ AST_MATCHER(CXXConstructExpr, isSafeSpanTwoParamConstruct)
{
}
return false;
}
+
+AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) {
+ // FIXME: Proper solution:
+ // - refactor Sema::CheckArrayAccess
+ //- split safe/OOB/unknown decision
@@ -848,6 +852,60 @@ class PointerAssignmentGadget : public FixableGadget {
}
};
+/// An assignment expression of the form:
+/// \code
+/// ptr = array;
+/// \endcode
+/// where `p` is a pointer and `array` is a constant size array.
+class CArrayToPtrAssignmentGadget : pu
@@ -1490,6 +1548,26 @@ PointerAssignmentGadget::getFixits(const FixitStrategy
&S) const {
return std::nullopt;
}
+/// \returns fixit that adds .data() call after \DRE.
+static inline std::optional createDataFixit(const ASTContext &Ctx,
+
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage \
+// RUN:-fsafe-buffer-usage-suggestions \
+// RUN:-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+
+void safe_array_assigned_to_safe_ptr(unsigned idx) {
+ int buffer[10];
+ //
https://github.com/haoNoQ commented:
LGTM! I have a couple minor nitpicks.
https://github.com/llvm/llvm-project/pull/81343
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
Looks great now!
https://github.com/llvm/llvm-project/pull/81808
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/81808
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
LGTM let's land!
https://github.com/llvm/llvm-project/pull/81343
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Brianna Fan
Date: 2024-02-14T19:08:07-08:00
New Revision: dcbb574cfc3445251ff1c751f27b52ed6503bead
URL:
https://github.com/llvm/llvm-project/commit/dcbb574cfc3445251ff1c751f27b52ed6503bead
DIFF:
https://github.com/llvm/llvm-project/commit/dcbb574cfc3445251ff1c751f27b52ed6503bead.diff
L
haoNoQ wrote:
Oh, this sort of stuff usually happens because the default target triple in the
test is the target triple for the host machine, so you'll get different
target-specific compiler behavior on different buildbots, in particular
`sizeof(unsigned long)` may be different. You can add eg
https://github.com/haoNoQ approved this pull request.
This probably works thanks!
https://github.com/llvm/llvm-project/pull/81903
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/81903
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
haoNoQ wrote:
Fix merged, thanks!
https://github.com/llvm/llvm-project/pull/81808
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
https://github.com/llvm/llvm-project/pull/81829
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/81927
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/82063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -356,6 +364,14 @@ class TrivialFunctionAnalysisVisitor
return TrivialFunctionAnalysis::isTrivialImpl(Callee, Cache);
}
+ bool VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *E) {
haoNoQ wrote:
In theory this may need to be cached because it may caus
https://github.com/haoNoQ approved this pull request.
LGTM thanks!
https://github.com/llvm/llvm-project/pull/82063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -25,6 +25,11 @@ using namespace ento;
namespace {
+bool stringEndsWith(const std::string &str, const std::string &suffix) {
+ auto index = str.rfind(suffix);
+ return index != std::string::npos && str.size() - suffix.size() == index;
+}
haoNoQ wrote:
Co
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/82156
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
haoNoQ wrote:
Hmm, no, I landed it because I made an assumption that there's simply not that
much interest in this work (I'm quite depressed about this in general lately)
so as a code owner I just made a call that it's probably good enough to go and
rely on post-commit review. Now that you bri
haoNoQ wrote:
Ok gotcha thanks! In any case, I'll do my best to handle this more gracefully
in the future. Your advice is always appreciated!
https://github.com/llvm/llvm-project/pull/80371
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https
https://github.com/haoNoQ approved this pull request.
Ooo this is much cleaner!
https://github.com/llvm/llvm-project/pull/82156
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/82209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -103,15 +103,18 @@ std::optional isRefCountable(const CXXRecordDecl* R)
return hasRef && hasDeref;
}
+bool isRefType(const std::string &name) {
+ return name == "Ref" || name == "RefAllowingPartiallyDestroyed" ||
+ name == "RefPtr" || name == "RefPtrAllowingParti
https://github.com/haoNoQ approved this pull request.
LGTM! I have one stylistic nitpick.
https://github.com/llvm/llvm-project/pull/82209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit
haoNoQ wrote:
Ooo interesting. I want to spend a bit more time thinking whether this has to
go into every callback, maybe it can be a set-and-forget thing? (Probably not.)
Also it might be a good idea to cache only statements that may ever get
directly queried. (This seems to be exactly necess
haoNoQ wrote:
> > I want to spend a bit more time thinking whether this has to go into every
> > callback, maybe it can be a set-and-forget thing? (Probably not.)
>
> What do you mean by set-and-forget?
I mean like, so that you didn't have to remember to edit every callback in a
specific way
https://github.com/haoNoQ commented:
Thanks a lot!! Some comments are very much overdue here.
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-co
https://github.com/haoNoQ 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
@@ -326,6 +326,12 @@ class LocAsInteger : public NonLoc {
static bool classof(SVal V) { return V.getKind() == LocAsIntegerKind; }
};
+/// The simplest example of a concrete compound value is nonloc::CompoundVal,
+/// which represents a concrete r-value of an initializer-list
@@ -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
@@ -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
@@ -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
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?=
Message-ID:
In-Reply-To:
haoNoQ wrote:
`-Wunsafe-buffer-usage` is theoretically possible to use in C but it involves a
lot of `#pragma clang unsafe_buffer_usage` to annotate and encapsulate every
unsafe buffer operation. So it's impractical but we aren't disabling it because
that'd be an unnecessary restriction and it
https://github.com/haoNoQ commented:
Aha makes sense!
Looks like you're putting no restrictions on what the opaque function is. This
may cause some false negatives but it's probably ultimately ok, but it might be
a good idea to confirm.
https://github.com/llvm/llvm-project/pull/107676
___
https://github.com/haoNoQ edited
https://github.com/llvm/llvm-project/pull/107676
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -67,6 +68,15 @@ class DerefFuncDeleteExprVisitor
const Decl *D = CE->getCalleeDecl();
if (D && D->hasBody())
return VisitBody(D->getBody());
+else if (!VisitLambdaBody) {
+ for (unsigned i = 0; i < CE->getNumArgs(); ++i) {
+auto *Arg = CE->getA
@@ -67,6 +68,48 @@ class DerefFuncDeleteExprVisitor
const Decl *D = CE->getCalleeDecl();
if (D && D->hasBody())
return VisitBody(D->getBody());
+else {
+ auto name = safeGetName(D);
+ if (name == "ensureOnMainThread" || name == "ensureOnMainRunLoop")
https://github.com/haoNoQ approved this pull request.
Aha great LGTM!
https://github.com/llvm/llvm-project/pull/107676
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
https://github.com/llvm/llvm-project/pull/108167
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -143,6 +143,16 @@ bool isReturnValueRefCounted(const clang::FunctionDecl *F)
{
return false;
}
+std::optional isUncounted(const clang::QualType T) {
haoNoQ wrote:
`clang::` is redundant because you're in `using namespace clang`.
https://github.com/llvm
https://github.com/haoNoQ edited
https://github.com/llvm/llvm-project/pull/108184
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ edited
https://github.com/llvm/llvm-project/pull/108184
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ edited
https://github.com/llvm/llvm-project/pull/108184
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
Aha ok LGTM!
https://github.com/llvm/llvm-project/pull/108184
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -143,6 +143,16 @@ bool isReturnValueRefCounted(const clang::FunctionDecl *F)
{
return false;
}
+std::optional isUncounted(const QualType T) {
+ if (auto *Subst = dyn_cast(T)) {
+if (auto *Decl = Subst->getAssociatedDecl()) {
+ if (isRefType(safeGetName(Decl)))
haoNoQ wrote:
Ah classic! Forgotten `.getCanonicalType()`s always get me.
https://github.com/llvm/llvm-project/pull/102953
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -404,7 +404,7 @@ AST_MATCHER(CXXConstructExpr, isSafeSpanTwoParamConstruct) {
if (Arg0Ty->isConstantArrayType()) {
const APSInt ConstArrSize =
-APSInt(cast(Arg0Ty)->getSize());
+APSInt(cast(Arg0Ty.getCanonicalType())->getSize());
haoNo
https://github.com/haoNoQ edited
https://github.com/llvm/llvm-project/pull/101585
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
LGTM!!
https://github.com/llvm/llvm-project/pull/101585
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6835,6 +6837,31 @@ the proper solution would be to create a different
function (possibly
an overload of ``baz()``) that accepts a safe container like ``bar()``,
and then use the attribute on the original ``baz()`` to help the users
update their code to use the new function
https://github.com/haoNoQ 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
@@ -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
https://github.com/haoNoQ approved this pull request.
I too think this checker can be safely deleted. To the best of my knowledge,
nobody is using it.
https://github.com/llvm/llvm-project/pull/103059
___
cfe-commits mailing list
cfe-commits@lists.llvm
901 - 1000 of 1254 matches
Mail list logo