[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-gcc-ubuntu` running on `sie-linux-worker3` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/16498 Her

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/136345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/136345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/136345 >From bcc3a8d0654d7a92183fb5b010892740c593e012 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 18 Apr 2025 22:01:02 +0300 Subject: [PATCH 1/3] [clang][Analyzer] Fix error path of builtin overflow ---

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: > I noticed you promptly fixed the linked issue. You shouldn't need to feel > pressured for a fix right away. I just feel bad when introduce bugs and want to fix them asap. Thanks for review! https://github.com/llvm/llvm-project/pull/136345 _

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Pavel Skripkin via cfe-commits
@@ -121,30 +120,24 @@ class BuiltinFunctionChecker : public Checker { } // namespace -const NoteTag *BuiltinFunctionChecker::createBuiltinNoOverflowNoteTag( -CheckerContext &C, bool BothFeasible, SVal Arg1, SVal Arg2, -SVal Result) const { - return C.getNoteTag([Res

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Pavel Skripkin via cfe-commits
@@ -194,30 +187,28 @@ void BuiltinFunctionChecker::handleOverflowBuiltin(const CallEvent &Call, SVal RetVal = SVB.evalBinOp(State, Op, Arg1, Arg2, ResultType); auto [Overflow, NotOverflow] = checkOverflow(C, RetValMax, ResultType); - if (NotOverflow) { -ProgramStateR

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Balazs Benics via cfe-commits
@@ -121,30 +120,24 @@ class BuiltinFunctionChecker : public Checker { } // namespace -const NoteTag *BuiltinFunctionChecker::createBuiltinNoOverflowNoteTag( -CheckerContext &C, bool BothFeasible, SVal Arg1, SVal Arg2, -SVal Result) const { - return C.getNoteTag([Res

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Balazs Benics via cfe-commits
@@ -194,30 +187,28 @@ void BuiltinFunctionChecker::handleOverflowBuiltin(const CallEvent &Call, SVal RetVal = SVB.evalBinOp(State, Op, Arg1, Arg2, ResultType); auto [Overflow, NotOverflow] = checkOverflow(C, RetValMax, ResultType); - if (NotOverflow) { -ProgramStateR

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. The tests and functionality looks correct to me. I noticed you promptly fixed the linked issue. You shouldn't need to feel pressured for a fix right away. I appreciate your swiftness and enthausiesm. https://github.com/llvm/llv

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Balazs Benics via cfe-commits
@@ -194,30 +187,28 @@ void BuiltinFunctionChecker::handleOverflowBuiltin(const CallEvent &Call, SVal RetVal = SVB.evalBinOp(State, Op, Arg1, Arg2, ResultType); auto [Overflow, NotOverflow] = checkOverflow(C, RetValMax, ResultType); - if (NotOverflow) { -ProgramStateR

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-20 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/136345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-18 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/136345 >From bcc3a8d0654d7a92183fb5b010892740c593e012 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 18 Apr 2025 22:01:02 +0300 Subject: [PATCH 1/2] [clang][Analyzer] Fix error path of builtin overflow ---

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-18 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions cpp,c -- clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionCh

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 @llvm/pr-subscribers-clang Author: Pavel Skripkin (pskrgag) Changes According to https://clang.llvm.org/docs/LanguageExtensions.html#checked-arithmetic-builtins, result of builtin_*_overflow functions will be initialized even in

[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)

2025-04-18 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag created https://github.com/llvm/llvm-project/pull/136345 According to https://clang.llvm.org/docs/LanguageExtensions.html#checked-arithmetic-builtins, result of builtin_*_overflow functions will be initialized even in case of overflow. Align analyzer logic to docs a