[clang] [clang][ASTImporter] Fix import of template parameter default values. (PR #100100)

2024-07-29 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/100100 From e4440b82f3d1fe5c7cafbad87da0e266d35a619e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Tue, 23 Jul 2024 11:20:22 +0200 Subject: [PATCH 1/2] [clang][ASTImporter] Fix import of tem

[clang] [analyzer] Fix crash of StreamChecker when eval calling 'fopen' (PR #100990)

2024-07-29 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. This looks good now, documentation could be a bit more exact in that operations on standard streams are not checked by the checker, like any other operation on streams that are not opened on the analysis path. https://github.com/llvm/llvm

[clang] [clang][ASTImporter] Remove trailing return testing on lambda proto (PR #101031)

2024-07-31 Thread Balázs Kéri via cfe-commits
balazske wrote: This looks like a good fix if there is no other way to detect the "C++11 lambda without parentheses" case. https://github.com/llvm/llvm-project/pull/101031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [clang][ASTImporter] Remove trailing return testing on lambda proto (PR #101031)

2024-07-31 Thread Balázs Kéri via cfe-commits
balazske wrote: > Here can `ToProcess.append(CurrentS->child_begin(), CurrentS->child_end());` > add any nullptr into `ToProcess` in this testing context? I think it is possible, but I could not reproduce this case with the shown code. https://github.com/llvm/llvm-project/pull/101031 ___

[clang] [clang][ASTImporter] Fix import of anonymous enums if multiple are present (PR #99281)

2024-07-17 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/99281 After the last change in PR #87144 regressions appeared in some cases. The problem was that if multiple anonymous enums are present in a class and are imported as new the import of the second enum can fail beca

[clang] [clang][ASTImporter] Fix import of anonymous enums if multiple are present (PR #99281)

2024-07-17 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/99281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-07-19 Thread Balázs Kéri via cfe-commits
@@ -21,30 +21,55 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/Checker

[clang] [clang][ASTImporter] Fix possible crash "given incorrect InsertPos for specialization". (PR #89887)

2024-04-24 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/89887 In some situations a new `VarTemplateSpecializationDecl` (for the same template) can be added during import of another one. The "insert position" that is used to insert the current object into the list of speci

[clang] [clang][ASTImporter] Fix possible crash "given incorrect InsertPos for specialization". (PR #89887)

2024-04-24 Thread Balázs Kéri via cfe-commits
balazske wrote: A test is needed to make the change acceptable but I could not find an easy case to provoke the situation. The problem looks to be related to his code: ```c++ using size_t = int; template class tuple; template struct integral_constant { static constexpr T value = v; usin

[clang] [NFC][analyzer] Initialize pointer field in StreamOperationEvaluator (PR #89837)

2024-04-24 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. Probably add [clang] tag to the title. https://github.com/llvm/llvm-project/pull/89837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang][analyzer] Move StreamChecker out of the alpha package. (PR #89247)

2024-04-30 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/89247 From 7138f026e845ebb4f1a3e6a86bdeb534d666ae7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 18 Apr 2024 16:40:03 +0200 Subject: [PATCH 1/5] [clang][analyzer] Move StreamChecker ou

[clang] [clang][analyzer] Move StreamChecker out of the alpha package. (PR #89247)

2024-04-30 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/89247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-30 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/101836 From 2e98fc222566c5e746ade4ccaba23de3b59e0a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Sat, 3 Aug 2024 18:10:34 +0200 Subject: [PATCH 1/3] [clang][ASTImporter] New fix for defaul

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

2024-08-30 Thread Balázs Kéri via cfe-commits
@@ -5968,11 +5962,21 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { } if (D->hasDefaultArgument()) { +// Default argument can be "inherited" when it has a reference to the +// previous declaration (of the default argument) which is stored

[clang] [clang][analyzer] Bring alpha.security.MmapWriteExec checker out of alpha package (PR #102636)

2024-08-30 Thread Balázs Kéri via cfe-commits
balazske wrote: I have tested it on some of the projects but there are not results from this checker. The detected type of bug looks unlikely so it is difficult to test the checker this way. https://github.com/llvm/llvm-project/pull/102636 ___ cfe-co

[clang] [clang][analyzer] Bring alpha.security.MmapWriteExec checker out of alpha package (PR #102636)

2024-09-02 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/102636 From 11e871ab17c119c71b8ef4bbcd3b186ec0e9a14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Fri, 9 Aug 2024 17:41:46 +0200 Subject: [PATCH] [clang][analyzer] Bring checker alpha.secur

[clang] [clang][analyzer] Bring alpha.security.MmapWriteExec checker out of alpha package (PR #102636)

2024-09-02 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/102636 From 11e871ab17c119c71b8ef4bbcd3b186ec0e9a14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Fri, 9 Aug 2024 17:41:46 +0200 Subject: [PATCH 1/2] [clang][analyzer] Bring checker alpha.

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

2024-09-02 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/102432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Bring alpha.security.MmapWriteExec checker out of alpha package (PR #102636)

2024-09-03 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/102636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add checker 'Security.SetgidSetuidOrder'. (PR #91445)

2024-05-08 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/91445 None From d839faf7a30851a172d812137b30635c741870f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 8 May 2024 10:10:24 +0200 Subject: [PATCH] [clang][analyzer] Add checker 'Securit

[clang] [clang][analyzer] Add checker 'Security.SetgidSetuidOrder'. (PR #91445)

2024-05-08 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/91445 From d839faf7a30851a172d812137b30635c741870f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 8 May 2024 10:10:24 +0200 Subject: [PATCH 1/2] [clang][analyzer] Add checker 'Security

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder'. (PR #91445)

2024-05-08 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,197 @@ +//===-- SetgidSetuidOrderChecker.cpp - check privilege revocation calls ---===// +// +// 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

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder'. (PR #91445)

2024-05-08 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/91445 From d839faf7a30851a172d812137b30635c741870f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 8 May 2024 10:10:24 +0200 Subject: [PATCH 1/3] [clang][analyzer] Add checker 'Security

[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

2024-05-09 Thread Balázs Kéri via cfe-commits
@@ -39,10 +39,15 @@ namespace { // Name of the "errno" variable. // FIXME: Is there a system where it is not called "errno" but is a variable? const char *ErrnoVarName = "errno"; + // Names of functions that return a location of the "errno" value. // FIXME: Are there other si

[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

2024-05-09 Thread Balázs Kéri via cfe-commits
@@ -71,12 +71,9 @@ ProgramStateRef setErrnoState(ProgramStateRef State, ErrnoCheckState EState); /// Clear state of errno (make it irrelevant). ProgramStateRef clearErrnoState(ProgramStateRef State); -/// Determine if a `Decl` node related to 'errno'. -/// This is true if the

[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

2024-05-09 Thread Balázs Kéri via cfe-commits
@@ -54,16 +59,10 @@ class ErrnoModeling void checkLiveSymbols(ProgramStateRef State, SymbolReaper &SR) const; bool evalCall(const CallEvent &Call, CheckerContext &C) const; - // The declaration of an "errno" variable or "errno location" function. - mutable const Decl *Er

[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

2024-05-09 Thread Balázs Kéri via cfe-commits
@@ -71,12 +71,9 @@ ProgramStateRef setErrnoState(ProgramStateRef State, ErrnoCheckState EState); /// Clear state of errno (make it irrelevant). ProgramStateRef clearErrnoState(ProgramStateRef State); -/// Determine if a `Decl` node related to 'errno'. -/// This is true if the

[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

2024-05-10 Thread Balázs Kéri via cfe-commits
@@ -74,9 +73,13 @@ REGISTER_TRAIT_WITH_PROGRAMSTATE(ErrnoRegion, const MemRegion *) REGISTER_TRAIT_WITH_PROGRAMSTATE(ErrnoState, errno_modeling::ErrnoCheckState) -/// Search for a variable called "errno" in the AST. -/// Return nullptr if not found. -static const VarDecl *ge

[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

2024-05-10 Thread Balázs Kéri via cfe-commits
@@ -136,53 +100,48 @@ void ErrnoModeling::checkBeginFunction(CheckerContext &C) const { ASTContext &ACtx = C.getASTContext(); ProgramStateRef State = C.getState(); - if (const auto *ErrnoVar = dyn_cast_or_null(ErrnoDecl)) { -// There is an external 'errno' variable.

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder'. (PR #91445)

2024-05-10 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/91445 From d839faf7a30851a172d812137b30635c741870f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 8 May 2024 10:10:24 +0200 Subject: [PATCH 1/4] [clang][analyzer] Add checker 'Security

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder'. (PR #91445)

2024-05-10 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,197 @@ +//===-- SetgidSetuidOrderChecker.cpp - check privilege revocation calls ---===// +// +// 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

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder'. (PR #91445)

2024-05-10 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,197 @@ +//===-- SetgidSetuidOrderChecker.cpp - check privilege revocation calls ---===// +// +// 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

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder'. (PR #91445)

2024-05-10 Thread Balázs Kéri via cfe-commits
https://github.com/balazske deleted https://github.com/llvm/llvm-project/pull/91445 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder'. (PR #91445)

2024-05-10 Thread Balázs Kéri via cfe-commits
balazske wrote: Is it useful to add a note tag to the previous `setuid(getuid())` call? It can be (theoretically) in another function or otherwise in a remote place in the source code. https://github.com/llvm/llvm-project/pull/91445 ___ cfe-commits m

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder'. (PR #91445)

2024-05-10 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/91445 From d839faf7a30851a172d812137b30635c741870f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 8 May 2024 10:10:24 +0200 Subject: [PATCH 1/5] [clang][analyzer] Add checker 'Security

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder'. (PR #91445)

2024-05-10 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,170 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core,security.SetgidSetuidOrder -verify %s + +#include "Inputs/system-header-simulator-setgid-setuid.h" + +void correct_order() { + if (setgid(getgid()) == -1) +return; + if (setuid(getuid()) == -1) +return

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder'. (PR #91445)

2024-05-10 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,197 @@ +//===-- SetgidSetuidOrderChecker.cpp - check privilege revocation calls ---===// +// +// 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

[clang] [analyzer] Refactor recognition of the errno getter functions (PR #91531)

2024-05-13 Thread Balázs Kéri via cfe-commits
@@ -136,53 +100,48 @@ void ErrnoModeling::checkBeginFunction(CheckerContext &C) const { ASTContext &ACtx = C.getASTContext(); ProgramStateRef State = C.getState(); - if (const auto *ErrnoVar = dyn_cast_or_null(ErrnoDecl)) { -// There is an external 'errno' variable.

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-13 Thread Balázs Kéri via cfe-commits
@@ -1179,6 +1179,34 @@ security.insecureAPI.DeprecatedOrUnsafeBufferHandling (C) strncpy(buf, "a", 1); // warn } +security.SetgidSetuidOrder (C) +"" balazske wrote: Move the new checker into `unix`, or move the chroot checker i

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-13 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,185 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core,security.SetgidSetuidOrder -verify %s + +typedef int uid_t; +typedef int gid_t; + +int setuid(uid_t); +int setgid(gid_t); +int seteuid(uid_t); +int setegid(gid_t); +int setreuid(uid_t, uid_t); +int setregid(gid_

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-13 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,196 @@ +//===-- SetgidSetuidOrderChecker.cpp - check privilege revocation calls ---===// +// +// 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

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-14 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/91445 From d839faf7a30851a172d812137b30635c741870f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 8 May 2024 10:10:24 +0200 Subject: [PATCH 1/6] [clang][analyzer] Add checker 'Security

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-15 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/91445 From d839faf7a30851a172d812137b30635c741870f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 8 May 2024 10:10:24 +0200 Subject: [PATCH 1/7] [clang][analyzer] Add checker 'Security

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-15 Thread Balázs Kéri via cfe-commits
balazske wrote: I added the `NoteTag` support now (instead of a next PR). The `checkDeadSymbols` is removed, it does really not matter if the data remains in the GDM and this way it is used to display the note tag only for the last `setuid` call. https://github.com/llvm/llvm-project/pull/9144

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-16 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/91445 From d839faf7a30851a172d812137b30635c741870f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 8 May 2024 10:10:24 +0200 Subject: [PATCH 1/8] [clang][analyzer] Add checker 'Security

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-16 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/91445 From d839faf7a30851a172d812137b30635c741870f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 8 May 2024 10:10:24 +0200 Subject: [PATCH 1/9] [clang][analyzer] Add checker 'Security

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto . (PR #92424)

2024-05-16 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/92424 The "cert" package looks not useful and the checker has not a meaningful name with the old naming scheme. Additionally tests and documentation is updated. The checker looks good enough to be moved into non-alpha

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/92424 From 769523d392204eac6c48cb80a2282212f3edbbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Fri, 10 May 2024 17:30:23 +0200 Subject: [PATCH 1/2] [clang][analyzer] Move checker alpha.s

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-17 Thread Balázs Kéri via cfe-commits
balazske wrote: I moved the checker to `alpha.security` now and changed the name, and made the documentations more exact. https://github.com/llvm/llvm-project/pull/92424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [clang][analyzer] Move checker alpha.security.cert.pos.34c into security.PutenvWithAuto (PR #92424)

2024-05-21 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/92424 From 769523d392204eac6c48cb80a2282212f3edbbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Fri, 10 May 2024 17:30:23 +0200 Subject: [PATCH 1/3] [clang][analyzer] Move checker alpha.s

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-22 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/91445 From d839faf7a30851a172d812137b30635c741870f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 8 May 2024 10:10:24 +0200 Subject: [PATCH 01/10] [clang][analyzer] Add checker 'Securi

[clang] [clang][analyzer] Add checker 'security.SetgidSetuidOrder' (PR #91445)

2024-05-22 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/91445 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix possible crash "given incorrect InsertPos for specialization". (PR #89887)

2024-05-22 Thread Balázs Kéri via cfe-commits
balazske wrote: I could reproduce this assertion (with CTU analysis on project "contour"): ``` clang-19: llvm-project/clang/lib/AST/DeclTemplate.cpp:370: void clang::RedeclarableTemplateDecl::addSpecializationImpl(llvm::FoldingSetVector&, EntryType*, void*) [with Derived = clang::VarTemplateDec

[clang] [clang][ASTImporter] Fix possible crash "given incorrect InsertPos for specialization". (PR #89887)

2024-05-22 Thread Balázs Kéri via cfe-commits
balazske wrote: The problem is that there is a distance between getting the "InsertPos" and the insetion into the list. Between getting the `InsertPos` (`VarTemplate->findSpecialization`) and the insertion further AST import statements can occur and probably it can cause the list of specializa

[clang] [clang][analyzer] Move checker 'cert.pos.34c' (in alpha.security) into 'PutenvStackArray' (PR #92424)

2024-05-23 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/92424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move checker 'cert.pos.34c' (in alpha.security) into 'PutenvStackArray' (PR #92424)

2024-05-23 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/92424 From 769523d392204eac6c48cb80a2282212f3edbbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Fri, 10 May 2024 17:30:23 +0200 Subject: [PATCH 1/4] [clang][analyzer] Move checker alpha.s

[clang] [clang][analyzer] Move checker 'cert.pos.34c' (in alpha.security) into 'PutenvStackArray' (PR #92424)

2024-05-23 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/92424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] PutenvStackArrayChecker: No warning from 'main' (PR #93299)

2024-05-24 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/93299 None From 9baa8cc3a1a738a43deee811b51593db85d5c88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Fri, 24 May 2024 15:22:22 +0200 Subject: [PATCH] [clang][analyzer] PutenvStackArrayChe

[clang] [clang][ASTImporter] Fix possible crash "given incorrect InsertPos for specialization". (PR #89887)

2024-05-24 Thread Balázs Kéri via cfe-commits
balazske wrote: > Could you please show your commands which reproduced this crash? I tested > locally with the following commands and it runs OK. > > ```c++ > clang++ -cc1 -std=c++17 -emit-pch -o test.cpp.ast test.cpp > clang++ -cc1 -x c++ -ast-merge test.cpp.ast /dev/null -ast-dump > ``` Tha

[clang] [clang][analyzer] PutenvStackArrayChecker: No warning from 'main' (PR #93299)

2024-05-27 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/93299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-05-27 Thread Balázs Kéri via cfe-commits
@@ -717,18 +717,71 @@ const ExplodedNode *StreamChecker::getAcquisitionSite(const ExplodedNode *N, return nullptr; } +/// Invalidate only the requested elements instead of the whole buffer. +/// This is basically a refinement of the more generic 'escapeArgs' or +/// the pla

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-05-27 Thread Balázs Kéri via cfe-commits
@@ -717,18 +717,71 @@ const ExplodedNode *StreamChecker::getAcquisitionSite(const ExplodedNode *N, return nullptr; } +/// Invalidate only the requested elements instead of the whole buffer. +/// This is basically a refinement of the more generic 'escapeArgs' or +/// the pla

[clang] [analyzer] Refine invalidation caused by `fread` (PR #93408)

2024-05-27 Thread Balázs Kéri via cfe-commits
@@ -937,8 +990,21 @@ void StreamChecker::evalFreadFwrite(const FnDescription *Desc, // At read, invalidate the buffer in any case of error or success, // except if EOF was already present. - if (IsFread && !E.isStreamEof()) -State = escapeArgs(State, C, Call, {0}); +

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

2024-08-01 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed 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

[clang] [clang][ASTImporter] Remove trailing return testing on lambda proto (PR #101031)

2024-08-01 Thread Balázs Kéri via cfe-commits
balazske wrote: My concern was only that the return type check check can be too much overhead now if done for all C++11 lambdas but probably this type of lambda can not be recognized in other way (maybe from source locations?). But it is only the C++11 (not newer) case and it is more safe to c

[clang] [clang][ASTImporter] Remove trailing return testing on lambda proto (PR #101031)

2024-08-01 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/101031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] support import return with UnaryTransformType (PR #101517)

2024-08-03 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/101517 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-03 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/101836 Commit e4440b8 added a change that introduced new crash in an incorrectly handled case. This is fixed here. From 2e98fc222566c5e746ade4ccaba23de3b59e0a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20

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

2024-08-03 Thread Balázs Kéri via cfe-commits
@@ -9919,6 +9919,103 @@ TEST_P(ImportTemplateParmDeclDefaultValue, ImportExistingVarTemplate) { testImport(FromLastD); } +TEST_P(ImportTemplateParmDeclDefaultValue, + ImportParentTemplateDuringNonTypeTemplateParmDecl) { + // This wants to provoke that during import o

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

2024-08-08 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/102432 Notes appear at out-of-range array index for index value and array size. From b9753a79654b1428f753a2fad865eacdf0250ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 8 Aug 2024 0

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

2024-08-08 Thread Balázs Kéri via cfe-commits
balazske wrote: If the `ArrayBoundsV2` checker is finished it should find all of the cases in the test of `PointerSubChecker` that have out-of-bound indexing, and including the cases where a single variable is handled like an 1-element array? If yes the bounds check is not needed in this check

[clang-tools-extra] 9d8c3ad - [clang-tidy] Change code of SignalHandlerCheck (NFC).

2022-01-25 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2022-01-25T15:52:38+01:00 New Revision: 9d8c3ad94fad5dd5fb511af89c9e7c3679922ce0 URL: https://github.com/llvm/llvm-project/commit/9d8c3ad94fad5dd5fb511af89c9e7c3679922ce0 DIFF: https://github.com/llvm/llvm-project/commit/9d8c3ad94fad5dd5fb511af89c9e7c3679922ce0.diff L

[clang-tools-extra] b088237 - [clang-tidy] bugprone-signal-handler improvements: display call chain

2022-01-31 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2022-01-31T10:35:23+01:00 New Revision: b088237f08c4c48be64890a9418ae88532075888 URL: https://github.com/llvm/llvm-project/commit/b088237f08c4c48be64890a9418ae88532075888 DIFF: https://github.com/llvm/llvm-project/commit/b088237f08c4c48be64890a9418ae88532075888.diff L

[clang] 29b512b - [clang][analyzer] Add modeling of 'errno'.

2022-02-25 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2022-02-25T12:42:55+01:00 New Revision: 29b512ba322cb6dd2c45d5e07645e20db47fad0d URL: https://github.com/llvm/llvm-project/commit/29b512ba322cb6dd2c45d5e07645e20db47fad0d DIFF: https://github.com/llvm/llvm-project/commit/29b512ba322cb6dd2c45d5e07645e20db47fad0d.diff L

[clang] d8a2afb - [clang][analyzer] Add modeling of 'errno'.

2022-02-28 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2022-03-01T08:20:33+01:00 New Revision: d8a2afb244da6cd1c8753115610c74ed0312f2e2 URL: https://github.com/llvm/llvm-project/commit/d8a2afb244da6cd1c8753115610c74ed0312f2e2 DIFF: https://github.com/llvm/llvm-project/commit/d8a2afb244da6cd1c8753115610c74ed0312f2e2.diff L

[clang] 96e675b - [clang][ASTImporter] Add import support for SourceLocExpr.

2021-03-19 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-03-19T16:33:04+01:00 New Revision: 96e675bdd5c8bfef34135fb50bcc7f570f073639 URL: https://github.com/llvm/llvm-project/commit/96e675bdd5c8bfef34135fb50bcc7f570f073639 DIFF: https://github.com/llvm/llvm-project/commit/96e675bdd5c8bfef34135fb50bcc7f570f073639.diff L

[clang] ce9bade - [clang][ASTImporter] Add import API for 'const Type *' (NFC).

2021-03-22 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-03-22T14:38:49+01:00 New Revision: ce9bade1f2c6249cf4179842aeb5e7e3bb34ceec URL: https://github.com/llvm/llvm-project/commit/ce9bade1f2c6249cf4179842aeb5e7e3bb34ceec DIFF: https://github.com/llvm/llvm-project/commit/ce9bade1f2c6249cf4179842aeb5e7e3bb34ceec.diff L

[clang] 3cde27b - [clang][ASTImporter] Import "CapturedVLAType" in FieldDecl.

2021-03-23 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-03-23T09:54:25+01:00 New Revision: 3cde27bc563ce82ba081be5b650bec523df2c928 URL: https://github.com/llvm/llvm-project/commit/3cde27bc563ce82ba081be5b650bec523df2c928 DIFF: https://github.com/llvm/llvm-project/commit/3cde27bc563ce82ba081be5b650bec523df2c928.diff L

[clang] f6cdb2c - [clang][ASTImporter] Add import of DeducedTemplateSpecializationType.

2021-03-24 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-03-24T09:43:58+01:00 New Revision: f6cdb2c0a714f8921688de08858f34d8c776f0e6 URL: https://github.com/llvm/llvm-project/commit/f6cdb2c0a714f8921688de08858f34d8c776f0e6 DIFF: https://github.com/llvm/llvm-project/commit/f6cdb2c0a714f8921688de08858f34d8c776f0e6.diff L

[clang] 49c0ab6 - [clang][Checkers] Extend PthreadLockChecker state dump (NFC).

2021-03-31 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-03-31T11:19:42+02:00 New Revision: 49c0ab6d7611050ae902f6369fc878e17da453ad URL: https://github.com/llvm/llvm-project/commit/49c0ab6d7611050ae902f6369fc878e17da453ad DIFF: https://github.com/llvm/llvm-project/commit/49c0ab6d7611050ae902f6369fc878e17da453ad.diff L

[clang] ffcb4b4 - Revert "[clang][Checkers] Extend PthreadLockChecker state dump (NFC)."

2021-03-31 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-03-31T15:28:53+02:00 New Revision: ffcb4b43b799f518891088076ef083ca8f13c537 URL: https://github.com/llvm/llvm-project/commit/ffcb4b43b799f518891088076ef083ca8f13c537 DIFF: https://github.com/llvm/llvm-project/commit/ffcb4b43b799f518891088076ef083ca8f13c537.diff L

[clang] df4fa53 - [clang][Checkers] Extend PthreadLockChecker state dump (NFC).

2021-04-01 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-04-01T11:59:00+02:00 New Revision: df4fa53fddb61c2514e7e09fb7cdde53edced958 URL: https://github.com/llvm/llvm-project/commit/df4fa53fddb61c2514e7e09fb7cdde53edced958 DIFF: https://github.com/llvm/llvm-project/commit/df4fa53fddb61c2514e7e09fb7cdde53edced958.diff L

[clang] bee4813 - [clang][Checkers] Fix PthreadLockChecker state cleanup at dead symbol.

2021-04-06 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-04-06T11:15:29+02:00 New Revision: bee4813789a378584d43c65497a5efd2353a6606 URL: https://github.com/llvm/llvm-project/commit/bee4813789a378584d43c65497a5efd2353a6606 DIFF: https://github.com/llvm/llvm-project/commit/bee4813789a378584d43c65497a5efd2353a6606.diff L

[clang] 6e51991 - [clang][AST] Handle overload callee type in CallExpr::getCallReturnType.

2021-04-12 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-04-12T09:44:17+02:00 New Revision: 6e5199104914c2415092315388ed09fbd9d629f7 URL: https://github.com/llvm/llvm-project/commit/6e5199104914c2415092315388ed09fbd9d629f7 DIFF: https://github.com/llvm/llvm-project/commit/6e5199104914c2415092315388ed09fbd9d629f7.diff L

[clang-tools-extra] 530456c - [clang-tidy] Add new check 'bugprone-unhandled-exception-at-new'.

2021-04-14 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-04-14T09:33:11+02:00 New Revision: 530456caf9088b8eb237c0ab75086722ce0f2950 URL: https://github.com/llvm/llvm-project/commit/530456caf9088b8eb237c0ab75086722ce0f2950 DIFF: https://github.com/llvm/llvm-project/commit/530456caf9088b8eb237c0ab75086722ce0f2950.diff L

[clang-tools-extra] bda2028 - [clang-tidy] Add exception flag to bugprone-unhandled-exception-at-new test.

2021-04-14 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-04-14T10:01:05+02:00 New Revision: bda20282cb94faa97b2e50cb592eff3dec94f6b0 URL: https://github.com/llvm/llvm-project/commit/bda20282cb94faa97b2e50cb592eff3dec94f6b0 DIFF: https://github.com/llvm/llvm-project/commit/bda20282cb94faa97b2e50cb592eff3dec94f6b0.diff L

[clang] 0877b96 - [clang][ASTImporter] Fix a possible assertion failure `NeedsInjectedClassNameType(Decl)'.

2021-01-07 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-01-07T11:28:11+01:00 New Revision: 0877b963ef2d3c384b47f7a6161c9d9ab106a7f2 URL: https://github.com/llvm/llvm-project/commit/0877b963ef2d3c384b47f7a6161c9d9ab106a7f2 DIFF: https://github.com/llvm/llvm-project/commit/0877b963ef2d3c384b47f7a6161c9d9ab106a7f2.diff L

[clang] 726de41 - [clang][AST] Add get functions for CXXFoldExpr paren locations.

2021-01-21 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-01-21T14:35:42+01:00 New Revision: 726de41e2bfb1d0d65e08f103dcb12810fe99d60 URL: https://github.com/llvm/llvm-project/commit/726de41e2bfb1d0d65e08f103dcb12810fe99d60 DIFF: https://github.com/llvm/llvm-project/commit/726de41e2bfb1d0d65e08f103dcb12810fe99d60.diff L

[clang] b7ac68d - [clang][ASTImporter] Simplify code of attribute import [NFC].

2021-10-07 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-10-07T13:07:21+02:00 New Revision: b7ac68d01ef9a126ea0eb26b3526a78c9d39533a URL: https://github.com/llvm/llvm-project/commit/b7ac68d01ef9a126ea0eb26b3526a78c9d39533a DIFF: https://github.com/llvm/llvm-project/commit/b7ac68d01ef9a126ea0eb26b3526a78c9d39533a.diff L

[clang-tools-extra] a76cfc2 - [clang-tidy] Update documentation of check bugprone-unused-return-value [NFC].

2021-10-12 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-10-12T16:43:45+02:00 New Revision: a76cfc2e840ff373b80e3a5f84fc48c5f1f90d8a URL: https://github.com/llvm/llvm-project/commit/a76cfc2e840ff373b80e3a5f84fc48c5f1f90d8a DIFF: https://github.com/llvm/llvm-project/commit/a76cfc2e840ff373b80e3a5f84fc48c5f1f90d8a.diff L

[clang] 4ff103c - [clang][ASTImporter] Fix for importing functions with EST_Unevaluated prototype.

2021-10-22 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-10-22T09:42:41+02:00 New Revision: 4ff103c024005fea997143a4bdb7918edd8712eb URL: https://github.com/llvm/llvm-project/commit/4ff103c024005fea997143a4bdb7918edd8712eb DIFF: https://github.com/llvm/llvm-project/commit/4ff103c024005fea997143a4bdb7918edd8712eb.diff L

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

2024-08-21 Thread Balázs Kéri via cfe-commits
@@ -5968,11 +5962,21 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { } if (D->hasDefaultArgument()) { +// Default argument can be "inherited" when it has a reference to the +// previous declaration (of the default argument) which is stored

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

2024-08-21 Thread Balázs Kéri via cfe-commits
@@ -5968,11 +5962,21 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { } if (D->hasDefaultArgument()) { +// Default argument can be "inherited" when it has a reference to the +// previous declaration (of the default argument) which is stored

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

2024-08-21 Thread Balázs Kéri via cfe-commits
@@ -5968,11 +5962,21 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { } if (D->hasDefaultArgument()) { +// Default argument can be "inherited" when it has a reference to the +// previous declaration (of the default argument) which is stored

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

2024-08-21 Thread Balázs Kéri via cfe-commits
@@ -5968,11 +5962,21 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { } if (D->hasDefaultArgument()) { +// Default argument can be "inherited" when it has a reference to the +// previous declaration (of the default argument) which is stored

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

2024-08-21 Thread Balázs Kéri via cfe-commits
@@ -5968,11 +5962,21 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { } if (D->hasDefaultArgument()) { +// Default argument can be "inherited" when it has a reference to the +// previous declaration (of the default argument) which is stored

[clang] [clang][analyzer] Bring alpha.security.MmapWriteExec checker out of alpha package (PR #102636)

2024-08-22 Thread Balázs Kéri via cfe-commits
balazske wrote: It is not easy to find an easily compilable (and not too big) project that contains `mmap` to test the checker. I could test it with libgit2, can try to find more projects to test. https://github.com/llvm/llvm-project/pull/102636 ___

[clang] [clang][ASTImporter] set nonnull type for var specialized from lambda template (PR #105492)

2024-08-22 Thread Balázs Kéri via cfe-commits
balazske wrote: This fix looks good, but I can not tell now why it would not work to import the type just before construction of the `VarTemplateSpecializationDecl`. I tried it and all tests passed. Probably I can test this on a set of projects. https://github.com/llvm/llvm-project/pull/105492

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

2024-08-23 Thread Balázs Kéri via cfe-commits
@@ -5968,11 +5962,21 @@ ASTNodeImporter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { } if (D->hasDefaultArgument()) { +// Default argument can be "inherited" when it has a reference to the +// previous declaration (of the default argument) which is stored

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

2024-06-24 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/95899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    2   3   4   5   6   7   8   9   10   >