=?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
=?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/145895
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mail
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -173,13 +173,16 @@ def have_host_clang_repl_cuda():
config.available_features.add("staticanalyzer")
tools.append("clang-check")
+I_z3_include_dir = ""
if config.clang_staticanalyzer_z3:
config.avai
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -173,13 +173,16 @@ def have_host_clang_repl_cuda():
config.available_features.add("staticanalyzer")
tools.append("clang-check")
+I_z3_include_dir = ""
if config.clang_staticanalyzer_z3:
config.avai
=?utf-8?q?Don=C3=A1t?= Nagy
Message-ID:
In-Reply-To:
https://github.com/steakhal requested changes to this pull request.
I'm not convinced about this change.
https://github.com/llvm/llvm-project/pull/146042
___
cfe-commits mailing list
cfe-commits@l
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/146042
___
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 ,
=?utf-8?q?Don=C3=A1t?= Nagy
Message-ID:
In-Reply-To:
steakhal wrote:
@NagyDonat Can you look into this reported failure?
https://github.com/llvm/llvm-project/pull/145731
_
=?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:
@mgorny I'm no longer available. Could you or anyone revert this or disable the
failing tests using an "UNSPUPPORTED: *"?
https://github.com/llvm/llvm-pr
@@ -10,7 +10,7 @@
// DEFINE: %{mocked_clang} = \
// DEFINE: LD_PRELOAD="%t/MockZ3_solver_check.so" \
-// DEFINE: %clang_cc1 %s -analyze -setup-static-analyzer \
+// DEFINE: %clang_analyze_cc1 %s -setup-static-analyzer \
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/145895
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-constraints=z3 -setup-static-analyzer \
+// RUN: %clang_analyze_cc1 -analyzer-constraints=z3 -setup-static-analyzer \
steakhal wrote:
Can you drop the `-setup-static-analyzer`?
https://github.com/llvm/llvm-p
@@ -5,7 +5,7 @@
//
// RUN: Z3_SOLVER_RESULTS="SAT,SAT,SAT,SAT,UNDEF" \
// RUN: LD_PRELOAD="%t/MockZ3_solver_check.so" \
-// RUN: %clang_cc1 -analyze -analyzer-constraints=z3 -setup-static-analyzer \
+// RUN: %clang_analyze_cc1 -analyzer-constraints=z3 -setup-static-analyzer \
-
@@ -139,6 +139,11 @@ class MatchFinder {
///
/// It prints a report after match.
std::optional CheckProfiling;
+
+bool SkipDeclsInModules = false;
+
+MatchFinderOptions()
+: CheckProfiling(std::nullopt), SkipDeclsInModules(false) {}
https://github.com/steakhal closed
https://github.com/llvm/llvm-project/pull/116515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
steakhal wrote:
The intentions weren't clear. We can reopen this at any time if necessary.
https://github.com/llvm/llvm-project/pull/116515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/145630
___
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 ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -123,26 +123,10 @@ S getS();
S *getSP();
void testReferenceAddress(int &x) {
-// FIXME: Move non-zero reference assumption out of
RangeConstraintManager.cpp:422
-#ifdef ANALYZER_CM_Z3
- clang_anal
https://github.com/steakhal edited
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
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
@@ -123,26 +123,10 @@ S getS();
S *getSP();
void testReferenceAddress(int &x) {
-// FIXME: Move non-zero reference assumption out of
RangeConstraintManager.cpp:422
steakhal wrote:
Th
https://github.com/steakhal edited
https://github.com/llvm/llvm-project/pull/145229
___
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
Message-ID:
In-Reply-To:
https://github.com/steakhal approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/145731
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
=?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/145731
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
https://github.com/steakhal requested changes to this pull request.
Thank you for this PR. The PR summary explains the situation well and the patch
also looks correct to me modulo inline comments.
Did you pick up some issue, or just decided to fix this because it was annoying
to you?
If we hav
=?utf-8?q?Donát?= Nagy ,
=?utf-8?q?Donát?= Nagy
Message-ID:
In-Reply-To:
steakhal wrote:
> For background information see also some of the later comments on the
> discourse thread
> https://discourse.llvm.org/t/taking-ownership-of-clang-test-analysis/84689/6
Move this link into the PR summa
https://github.com/steakhal approved this pull request.
https://github.com/llvm/llvm-project/pull/145719
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -169,4 +169,20 @@ void record_uninit() {
// CHECK-SAME: a46bb5c1ee44d4611ffeb13f7f499605
// CHECK: issue_hash_content_of_line_in_context
// CHECK-SAME: e0e0d30ea5a7b2e3a71e1931fa0768a5
+
+struct B{
+ int i :2;
+ int:30; // unnamed bit-field
+};
+
+void bitfield_B_ini
@@ -259,7 +259,7 @@ class FindUninitializedField {
if (T->getAsStructureType()) {
if (Find(FR))
return true;
-} else {
+} else if (!I->isUnnamedBitField()){
steakhal wrote:
I think I'd rather move this check to the
@@ -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
@@ -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
@@ -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;
+
steakhal wrote:
Any news on this front?
https://github.com/llvm/llvm-project/pull/138295
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1469,6 +1470,12 @@ bool MatchASTVisitor::TraverseDecl(Decl *DeclNode) {
return true;
}
+ if (Options.SkipDeclsInModules && DeclNode->isFromASTFile()) {
+auto *M = DeclNode->getOwningModule();
+if (M && (M->isInterfaceOrPartition() || M->isGlobalModule()))
+
https://github.com/steakhal commented:
I also believe that the nodes from modules should not be traversed by default,
but there should be an option to allow traversing those - just like it's
implemented.
https://github.com/llvm/llvm-project/pull/145630
_
https://github.com/steakhal closed
https://github.com/llvm/llvm-project/pull/144906
___
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/145229
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1060,6 +1060,9 @@ impact the linker behaviour like the other `-static-*`
flags.
Crash and bug fixes
^^^
+- Fixed a crash in ``UnixAPIMisuseChecker`` and ``MallocChecker`` when
analyzing
+ code with non-standard ``getline`` or ``getdelim`` function signat
@@ -1518,14 +1518,19 @@ void MallocChecker::checkGetdelim(ProgramStateRef
State, const CallEvent &Call,
if (!CE)
return;
- const auto LinePtr =
- getPointeeVal(Call.getArgSVal(0), State)->getAs();
- const auto Size =
- getPointeeVal(Call.getArgSVal(1), State
1 - 100 of 2126 matches
Mail list logo