steakhal wrote:
> > I never understood the reasons of having metadata for placement-new.
>
> I don't think that there is any real reason for it, but I guess that some
> compilers reused code from the code of non-placement new.
>
> > Certainly on linux it was not the case, but I'm skeptical if
steakhal wrote:
> The code that you're removing is not an accidental bug, but an intentional
> (although perhaps overzealous) feature that tries to warn about the fact that
> placement new for an array type may allocate an unspecified amount of
> overhead (extra memory) for internal needs.
>
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/150133
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal approved this pull request.
LGTM, thanks!
https://github.com/llvm/llvm-project/pull/150139
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/150005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1103,7 +1103,16 @@ To override this threshold to e.g. 4 bytes, use the
optin.portability.UnixAPI
"
-Finds implementation-defined behavior in UNIX/Posix functions.
+Reports situations where 0 is passed as the "size" argument of various
+allocation fu
steakhal wrote:
As a Clang Static Analyzer maintainer I welcome this change and usually any NFC
change that is not a clangformat refactor.
I'll have a look once I have some free time.
https://github.com/llvm/llvm-project/pull/149934
___
cfe-commits m
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy
@@ -2187,7 +2187,10 @@ std::optional
RegionStoreManager::getBindingForDerivedDefaultValue(
// Lazy bindings are usually handled through getExistingLazyBinding().
// We should unify these two code paths at some point.
-if (isa(val))
+// 'nonloc::ConcreteInt' va
@@ -6298,10 +6304,60 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
@@ -6298,10 +6308,60 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
@@ -693,6 +703,153 @@ TEST_F(NoreturnDestructorTest,
ConditionalOperatorNestedBranchReturns) {
// FIXME: Called functions at point `p` should contain only "foo".
}
+class AnalyzerNoreturnTest : public Test {
+protected:
+ template
+ void runDataflow(llvm::StringRef Code,
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) {
// at least for now, but once we have better support for exceptions,
// we'd need to carefully handle the case when the throw is being
// immediately caught.
- if (llvm::any_of(*Blk, [](const
@@ -22,7 +22,7 @@ void_typedef f2_helper(void);
static void f2(void *buf) {
F12_typedef* x;
x = f2_helper();
- memcpy((&x[1]), (buf), 1); // expected-warning{{call to undeclared library
function 'memcpy' with type 'void *(void *, const void *}} \
+ memcpy((&x[1]), (buf),
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
@@ -959,6 +959,68 @@ ProgramStateRef
CStringChecker::checkAdditionOverflow(CheckerContext &C,
return state;
}
+ProgramStateRef CStringChecker::checkNullTerminated(CheckerContext &C,
+
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
steakhal wrote:
I frequently see you and @NagyDonat fighting clang-format. Let me share what I
use in my workflow.
I use VSCode, but this should work with any editor. Usually editors have hooks
for file saves.
I use the [Run on
Save](https://
https://github.com/steakhal approved this pull request.
Lets land this. Thank you!
https://github.com/llvm/llvm-project/pull/148988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
Sorry about my late reply. It took me a while to get back to this one.
https://github.com/llvm/llvm-project/pull/146664
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,295 @@
+//=== MissingTerminatingZeroChecker.cpp -*- C++
-*-===//
+//
+// 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
steakhal wrote:
@a-tarasyuk Could you also add the test case from the issue as-is?
https://github.com/llvm/llvm-project/pull/148988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4114,3 +4124,35 @@ void
*ProgramStateTrait::GDMIndex() {
}
void ExprEngine::anchor() { }
+
+void ExprEngine::ConstructInitList(const Expr *E, ArrayRef Args,
+ bool IsTransparent, ExplodedNode *Pred,
+ Exp
https://github.com/steakhal commented:
Looks really good. Thanks for going the extra mile with the refactor.
https://github.com/llvm/llvm-project/pull/148988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/148988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4114,3 +4124,35 @@ void
*ProgramStateTrait::GDMIndex() {
}
void ExprEngine::anchor() { }
+
+void ExprEngine::ConstructInitList(const Expr *E, ArrayRef Args,
+ bool IsTransparent, ExplodedNode *Pred,
+ Exp
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/148988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/148988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1233,3 +1233,34 @@ void ExprEngine::VisitAttributedStmt(const
AttributedStmt *A,
getCheckerManager().runCheckersForPostStmt(Dst, EvalSet, A, *this);
}
+
+void ExprEngine::VisitCXXParenListInitExpr(const CXXParenListInitExpr *E,
+
https://github.com/steakhal approved this pull request.
> Given that this PR closes #148988, I think it will make it more clear to
> include the code snippet from the issue verbatim
I think you wanted to link #148875 actually.
Yes, having a verbatim copy of the original issue makes sense it it
@@ -1233,3 +1233,34 @@ void ExprEngine::VisitAttributedStmt(const
AttributedStmt *A,
getCheckerManager().runCheckersForPostStmt(Dst, EvalSet, A, *this);
}
+
+void ExprEngine::VisitCXXParenListInitExpr(const CXXParenListInitExpr *E,
+
@@ -1233,3 +1233,34 @@ void ExprEngine::VisitAttributedStmt(const
AttributedStmt *A,
getCheckerManager().runCheckersForPostStmt(Dst, EvalSet, A, *this);
}
+
+void ExprEngine::VisitCXXParenListInitExpr(const CXXParenListInitExpr *E,
+
@@ -1233,3 +1233,34 @@ void ExprEngine::VisitAttributedStmt(const
AttributedStmt *A,
getCheckerManager().runCheckersForPostStmt(Dst, EvalSet, A, *this);
}
+
+void ExprEngine::VisitCXXParenListInitExpr(const CXXParenListInitExpr *E,
+
@@ -1233,3 +1233,34 @@ void ExprEngine::VisitAttributedStmt(const
AttributedStmt *A,
getCheckerManager().runCheckersForPostStmt(Dst, EvalSet, A, *this);
}
+
+void ExprEngine::VisitCXXParenListInitExpr(const CXXParenListInitExpr *E,
+
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/148988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal commented:
Looks good on the technical side. I have some questions mostly about code reuse.
https://github.com/llvm/llvm-project/pull/148988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-
steakhal wrote:
> I don't know much about the static analyzer, but perhaps Aaron can do a
> better review? I didn't see anything questionable however.
Moved this to the Static Analyzer folks.
https://github.com/llvm/llvm-project/pull/148988
___
cfe-c
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= ,
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= ,
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?=
Message-ID:
In-Reply-To:
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/147766
___
cfe-commi
=?utf-8?q?Balázs_Kéri?= ,
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
@@ -1022,6 +1022,23 @@ getStackOrCaptureRegionForDeclContext(const
LocationContext *LC,
return (const StackFrameContext *)nullptr;
}
+static bool isStdStreamVar(const VarDecl *D) {
+ const auto *
=?utf-8?q?Balázs_Kéri?= ,
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
@@ -1022,6 +1022,23 @@ getStackOrCaptureRegionForDeclContext(const
LocationContext *LC,
return (const StackFrameContext *)nullptr;
}
+static bool isStdStreamVar(const VarDecl *D) {
---
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= ,
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?=
Message-ID:
In-Reply-To:
https://github.com/steakhal requested changes to this pull request.
Looks pretty good! Unfortunately, I still found a couple of places to improve.
https://github.com/llvm/llvm-project/pull/147766
__
=?utf-8?q?Balázs_Kéri?= ,
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
@@ -1022,6 +1022,23 @@ getStackOrCaptureRegionForDeclContext(const
LocationContext *LC,
return (const StackFrameContext *)nullptr;
}
+static bool isStdStreamVar(const VarDecl *D) {
+ const auto *
=?utf-8?q?Balázs_Kéri?= ,
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/147766
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mail
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
@@ -1054,10 +1054,26 @@ const VarRegion *MemRegionManager::getVarRegion(const
VarDecl *D,
assert(!Ty.isNull());
if (Ty.isConstQualified()) {
sReg = getGlobalsRegion(MemRegion::GlobalImmutableSpaceRegionKind);
-
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
steakhal wrote:
> > BTW wouldn't this patch break the semantics of `freopen`? That one should
> > invalidate the file ptr, right? Could you demonstrate this?
>
> No, `freopen` should _not_ invalidate the file _ptr_, because it modifies the
>
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -112,26 +112,35 @@ class CheckerRegistry {
return true;
}
-public:
- /// Adds a checker to the registry. Use this non-templated overload when your
- /// checker requires custom initializatio
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy
Message-ID:
In-Reply-To:
https://github.com/steakhal requested changes to this pull request.
tiny nits. Indeed it would get simpler :)
https://github.com/llvm/llvm-project/pull/147797
___
cfe
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy
Message-ID:
In-Reply-To:
@@ -3,12 +3,16 @@
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h"
+// This simple plugin is used by clang/test/A
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -112,26 +112,35 @@ class CheckerRegistry {
return true;
}
-public:
- /// Adds a checker to the registry. Use this non-templated overload when your
- /// checker requires custom initializatio
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/147797
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
steakhal wrote:
BTW wouldn't this patch break the semantics of `freopen`? That one should
invalidate the file ptr, right?
Could you demonstrate this?
https://github.com/llvm/llvm-project/pull/147766
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
@@ -1054,10 +1054,26 @@ const VarRegion *MemRegionManager::getVarRegion(const
VarDecl *D,
assert(!Ty.isNull());
if (Ty.isConstQualified()) {
sReg = getGlobalsRegion(MemRegion::GlobalImmutableSpaceRegionKind);
-
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
@@ -519,14 +519,53 @@ void reopen_std_stream(void) {
if (!fp) return;
stdout = fp; // Let's make them alias.
- clang_analyzer_eval(fp == oldStdout); // expected-warning {{UNKNOWN}}
- clang_analyzer_eval(fp == stdout
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
@@ -1054,10 +1054,26 @@ const VarRegion *MemRegionManager::getVarRegion(const
VarDecl *D,
assert(!Ty.isNull());
if (Ty.isConstQualified()) {
sReg = getGlobalsRegion(MemRegion::GlobalImmutableSpaceRegionKind);
-
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
https://github.com/steakhal requested changes to this pull request.
I'd suggest rephrasing the PR to something more descriptive: Preserve stdin and
friends on system calls
https://github.com/llvm/llvm-project/pull/147766
__
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
@@ -1054,10 +1054,26 @@ const VarRegion *MemRegionManager::getVarRegion(const
VarDecl *D,
assert(!Ty.isNull());
if (Ty.isConstQualified()) {
sReg = getGlobalsRegion(MemRegion::GlobalImmutableSpaceRegionKind);
-
=?utf-8?q?Balázs_Kéri?=
Message-ID:
In-Reply-To:
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/147766
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy
Message-ID:
In-Reply-To:
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/147542
___
cfe-commits mailing list
cf
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -412,7 +412,7 @@ class DerefClass{
void testDoubleDeleteClassInstance() {
DerefClass *foo = new DerefClass();
delete foo;
- delete foo; // newdelete-warning {{Attempt to
https://github.com/steakhal approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/147536
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -412,7 +412,7 @@ class DerefClass{
void testDoubleDeleteClassInstance() {
DerefClass *foo = new DerefClass();
delete foo;
- delete foo; // newdelete-warning {{Attempt to delete released memory}}
+ delete foo; // newdel
=?utf-8?q?Don=C3=A1t?= Nagy
Message-ID:
In-Reply-To:
@@ -412,7 +412,7 @@ class DerefClass{
void testDoubleDeleteClassInstance() {
DerefClass *foo = new DerefClass();
delete foo;
- delete foo; // newdelete-warning {{Attempt to delete released memory}}
+ delete foo; // n
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -3324,7 +3298,7 @@ void MallocChecker::checkUseZeroAllocated(SymbolRef Sym,
CheckerContext &C,
bool MallocChecker::checkDoubleDelete(SymbolRef Sym, CheckerContext &C) const {
if (isReleased(Sym, C)) {
-HandleDoubleDe
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy ,
=?utf-8?q?Don=C3=A1t?= Nagy
Message-ID:
In-Reply-To:
ht
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -333,11 +333,55 @@ template
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -333,11 +333,55 @@ template static bool
isStandardNewDelete(const T &FD) {
return isStandardDelet
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
https://github.com/steakhal commented:
Thanks for the reviews already done.
I think as I skimmed through, I didn't have a
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -333,11 +333,55 @@ template static bool
isStandardNewDelete(const T &FD) {
return isStandardDelet
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -333,11 +333,55 @@ template static bool
isStandardNewDelete(const T &FD) {
return isStandardDelet
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/147080
_
@@ -0,0 +1,8 @@
+// RUN: %clang_analyze_cc1 -std=c++23 -analyzer-checker=core -verify %s
steakhal wrote:
I'd reject the idea of sprinkling ifdefs and feature detections.
Let's just move on.
https://github.com/llvm/llvm-project/pull/146859
__
@@ -0,0 +1,8 @@
+// RUN: %clang_analyze_cc1 -std=c++23 -analyzer-checker=core -verify %s
steakhal wrote:
I don't think it's possible to create RUN lines for standards of which the
flags are rejected by clang right now.
https://github.com/llvm/llvm-project/pull
@@ -0,0 +1,8 @@
+// RUN: %clang_analyze_cc1 -std=c++23 -analyzer-checker=core -verify %s
steakhal wrote:
I don't think we have tools for doing this.
https://github.com/llvm/llvm-project/pull/146859
___
cfe-commits mail
steakhal wrote:
FYI I really wish to come back to this PR, but I'm really busy.
https://github.com/llvm/llvm-project/pull/144224
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
> Hey, could you add a LIT test that fails before your changes but passes after?
Merge it once you are good. The added test should crash the analyzer without
the fix, [see](https://godbolt.org/z/jxTMnGEY7).
https://github.com/llvm/llvm-project/pull/146859
__
@@ -2122,8 +2122,21 @@ SVal
RegionStoreManager::getBindingForField(RegionBindingsConstRef B,
if (const std::optional &V = B.getDirectBinding(R))
return *V;
- // If the containing record was initialized, try to get its constant value.
+ // UnnamedBitField is always Und
@@ -0,0 +1,295 @@
+//=== MissingTerminatingZeroChecker.cpp -*- C++
-*-===//
+//
+// 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/steakhal approved this pull request.
Could you search the github issues for issues having the static analyzer label
and `consteval` to see if we missed anything? (I don't think we have, but
better be sure)
https://github.com/llvm/llvm-project/pull/146859
@@ -932,7 +932,8 @@ class Z3Statistics final : public SMTSolverStatistics {
};
unsigned getUnsigned(StringRef Key) const override {
auto It = UnsignedValues.find(Key.str());
-assert(It != UnsignedValues.end());
+if (It == UnsignedValues.end())
+ return 0;
-
@@ -2122,8 +2122,21 @@ SVal
RegionStoreManager::getBindingForField(RegionBindingsConstRef B,
if (const std::optional &V = B.getDirectBinding(R))
return *V;
- // If the containing record was initialized, try to get its constant value.
+ // UnnamedBitField is always Und
@@ -2122,8 +2122,21 @@ SVal
RegionStoreManager::getBindingForField(RegionBindingsConstRef B,
if (const std::optional &V = B.getDirectBinding(R))
return *V;
- // If the containing record was initialized, try to get its constant value.
+ // UnnamedBitField is always Und
@@ -0,0 +1,8 @@
+// RUN: %clang_analyze_cc1 -std=c++23 -analyzer-checker=core -verify %s
+
+void test_consteval() {
+ if consteval {
+int *ptr = nullptr;
+*ptr = 42; // expected-warning{{Dereference of null pointer (loaded from
variable 'ptr')}}
+ }
+}
@@ -2122,8 +2122,21 @@ SVal
RegionStoreManager::getBindingForField(RegionBindingsConstRef B,
if (const std::optional &V = B.getDirectBinding(R))
return *V;
- // If the containing record was initialized, try to get its constant value.
+ // UnnamedBitField is always Und
https://github.com/steakhal closed
https://github.com/llvm/llvm-project/pull/145066
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/145066
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/146706
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
I resign from review. I don't have time to review 100+ lines PRs right now.
https://github.com/llvm/llvm-project/pull/146212
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
@@ -2187,7 +2187,10 @@ std::optional
RegionStoreManager::getBindingForDerivedDefaultValue(
// Lazy bindings are usually handled through getExistingLazyBinding().
// We should unify these two code paths at some point.
-if (isa(val))
+// 'nonloc::ConcreteInt' va
@@ -598,6 +598,9 @@ class SMTConv {
if (APSIntBitwidth == 1 && Ty.isNull())
return {Int.extend(Ctx.getTypeSize(Ctx.BoolTy)),
getAPSIntType(Ctx, NewInt)};
+else if (APSIntBitwidth == 1 && !Ty.isNull())
+ return {Int.extend(Ctx.getTypeSize(getAPSI
@@ -932,7 +932,8 @@ class Z3Statistics final : public SMTSolverStatistics {
};
unsigned getUnsigned(StringRef Key) const override {
auto It = UnsignedValues.find(Key.str());
-assert(It != UnsignedValues.end());
+if (It == UnsignedValues.end())
+ return 0;
-
@@ -0,0 +1,107 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection
+// -analyzer-config c++-inlining=constructors -verify %s
+
+// expected-no-diagnostics
+
+typedef unsigned int size_t;
steakhal wrote:
You can always define this as the res
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/146212
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal commented:
Thanks for the detailed PR summary. It makes sense. I had to think about it
carefully but I agree with the motivation.
When I looked at the code it looked really complicated. Probably more than I
expected it to be.
I think adding another bool parameter to
@@ -0,0 +1,107 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection
+// -analyzer-config c++-inlining=constructors -verify %s
steakhal wrote:
This line is definitely ineffective. To make it part of the previous RUN line
you will need to end
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/146284
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/steakhal approved this pull request.
Looks really good. Sweet!
Thank you for this patch. If it works then it works.
There is only one thing though.
We have a couple uses of %clang_cc1 and we could substitute when we are at it.
See an example here https://github.com/llvm/llvm-
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
steakhal wrote:
I dont think we should (or you) invest too much. We can just mark this special
case with UNSUPPORTED and move on.
Is this issue caused by the standalone
https://github.com/steakhal approved this pull request.
Thank you for doing this extra mile. I really appreciate it.
I had a look at the patch and it makes sense. Looks good.
https://github.com/llvm/llvm-project/pull/146200
___
cfe-commits mailing lis
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
steakhal wrote:
> No problem. I would have submitted a patch earlier but this bisect is
> literally taking all my resources.
I'm pretty sure you have heard of
[manyclan
@@ -1,12 +1,19 @@
// RUN: %clang_analyze_cc1 %s -verify \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-config core.CallAndMessage:ArgPointeeInitializedness=true \
+// RUN: -analyzer-config core.CallAndMessage:ArgInitializedness=false \
// RUN: -analyzer-output=pl
@@ -22,3 +29,21 @@ void pointee_uninit(void) {
// checker, as described in the CallAndMessage comments!
// CHECK: issue_hash_content_of_line_in_context
// CHECK-SAME: 97a74322d64dca40aa57303842c745a1
+
+typedef struct {
+ int i :2;
+ int:30; // unnamed bit-field
+} B;
+
@@ -2122,8 +2122,21 @@ SVal
RegionStoreManager::getBindingForField(RegionBindingsConstRef B,
if (const std::optional &V = B.getDirectBinding(R))
return *V;
- // If the containing record was initialized, try to get its constant value.
+ // UnnamedBitField is always Und
1 - 100 of 2162 matches
Mail list logo