[clang] [clang][analyzer] Add C standard streams to the internal memory space (PR #147766)

2025-07-14 Thread Balázs Kéri via cfe-commits
@@ -1022,6 +1022,23 @@ getStackOrCaptureRegionForDeclContext(const LocationContext *LC, return (const StackFrameContext *)nullptr; } +static bool isStdStreamVar(const VarDecl *D) { balazske wrote: The current code should filter this out. Still it is not su

[clang] [clang][analyzer] Add C standard streams to the internal memory space (PR #147766)

2025-07-14 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/147766 From f8dc303029c68762cdbd19b217730192d26f6fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 9 Jul 2025 16:55:07 +0200 Subject: [PATCH 1/4] [clang][analyzer] Add C standard stream

[clang] [clang][analyzer] Improve checker 'unix.cstring.NotNullTerminated' (PR #149106)

2025-07-17 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/149106 From ba535f818b36e5ab758b4148e46816e8f3ee6550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 2 Jul 2025 11:09:58 +0200 Subject: [PATCH 1/2] [clang][analyzer] Improve checker 'uni

[clang] [clang][analyzer] Add checker 'unix.cstring.MissingTerminatingZero' (PR #146664)

2025-07-04 Thread Balázs Kéri via cfe-commits
@@ -2098,6 +2098,58 @@ Check the size argument passed into C string functions for common erroneous patt // warn: potential buffer overflow } +.. _unix-cstring-MissingTerminatingZero: + +unix.cstring.MissingTerminatingZero (C) +""" +Ch

[clang] [clang][analyzer] Add checker 'unix.cstring.MissingTerminatingZero' (PR #146664)

2025-07-04 Thread Balázs Kéri via 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

[clang] [clang][analyzer] Add C standard streams to the internal memory space (PR #147766)

2025-07-09 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/147766 If variables `stdin`, `stdout`, `stderr` are added to the system memory space, they are invalidated at any call to system (or C library) functions. These variables are not expected to be changed by system func

[clang] move ASTImporter into separate library (PR #140913)

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

[clang] [clang][ASTImporter] try fix missing Visit functions for issue #129393 (PR #138845)

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

[clang] [clang][analyzer] Add C standard streams to the internal memory space (PR #147766)

2025-07-10 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/147766 From f8dc303029c68762cdbd19b217730192d26f6fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 9 Jul 2025 16:55:07 +0200 Subject: [PATCH 1/2] [clang][analyzer] Add C standard stream

[clang] [clang][analyzer] Add C standard streams to the internal memory space (PR #147766)

2025-07-11 Thread Balázs Kéri via cfe-commits
@@ -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);// expected-warning {{TRUE}} no-FALSE -

[clang] [clang][analyzer] Add C standard streams to the internal memory space (PR #147766)

2025-07-11 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/147766 From f8dc303029c68762cdbd19b217730192d26f6fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 9 Jul 2025 16:55:07 +0200 Subject: [PATCH 1/3] [clang][analyzer] Add C standard stream

[clang] [clang][analyzer] Add checker 'unix.cstring.MissingTerminatingZero' (PR #146664)

2025-07-04 Thread Balázs Kéri via 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

[clang] [clang][analyzer] Add checker 'unix.cstring.MissingTerminatingZero' (PR #146664)

2025-07-04 Thread Balázs Kéri via 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

[clang] [clang][analyzer] Add checker 'unix.cstring.MissingTerminatingZero' (PR #146664)

2025-07-02 Thread Balázs Kéri via cfe-commits
https://github.com/balazske converted_to_draft 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

[clang] [clang][analyzer] Add checker 'unix.cstring.MissingTerminatingZero' (PR #146664)

2025-07-02 Thread Balázs Kéri via cfe-commits
balazske wrote: Pointer escape and region changes are not handled yet. 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

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-06-30 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/136823 From 4ce7497bb0dc89de3b9f139177c295291e7d3e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 17 Apr 2025 17:36:03 +0200 Subject: [PATCH 1/6] [clang-tidy] Add check 'bugprone-inva

[clang] Ast importer visitors (PR #138838)

2025-06-30 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. I think we can put in this change. I tested it on some projects, the number of crashes got less after this change (it is possible that new ones appeared but the total count was less). https://github.com/llvm/llvm-project/pull/138838 _

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-06-30 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/140086 From 65d44a4eb9621e49a96f1ac43e5a1bbd6691dc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 15 May 2025 17:41:16 +0200 Subject: [PATCH 1/9] [clang-tidy] Added check 'bugprone-fu

[clang] [clang][analyzer] Add checker 'unix.cstring.MissingTerminatingZero' (PR #146664)

2025-07-02 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/146664 A new checker for checking if terminating zero is missing from a string. There is an existing `unix.cstring.NotNullTerminated` checker that looks similar but checks just if a non-string like object is passed t

[clang] [clang][analyzer] Add checker 'unix.cstring.MissingTerminatingZero' (PR #146664)

2025-07-18 Thread Balázs Kéri via cfe-commits
balazske wrote: The two patches (#149106 and this) are a different solution for the problem. I started the other because it looks more difficult to make this checker work if memory invalidations happen, probably many cases should be handled to maintain the checker internal data. The other solu

<    5   6   7   8   9   10