[clang] [analyzer] Model overflow builtins (PR #102602)

2024-10-04 Thread Balazs Benics via cfe-commits
steakhal wrote: FYI this PR likely caused a crash, reported in #47. https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-10-03 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-libc-amdgpu-runtime` running on `omp-vega20-1` while building `clang` at step 10 "Add check check-offload". Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/6544 Here is the r

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-10-03 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-arm-ubuntu` running on `linaro-lldb-arm-ubuntu` while building `clang` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/4864 Here is the relevant piece of the build log

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-10-03 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `fuchsia-x86_64-linux` running on `fuchsia-debian-64-us-central1-a-1` while building `clang` at step 4 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/6049 Here is the relevant p

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-10-03 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-10-02 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 7b4f999b39f4308cab253204e6be41ea7a70f695 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 01/12] clang/csa: add initial support for builtin overflow ---

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-10-02 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: Ah, this dangling reference to rvalue... I do remember why I bind `get{Min, Max}Value` to locals -- `ConcreteInt` takes a reference to `APSInt`, so it's not possible to pass result of these calls directly to constructor. https://github.com/llvm/llvm-project/pull/102602 _

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-10-02 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 7b4f999b39f4308cab253204e6be41ea7a70f695 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 01/11] clang/csa: add initial support for builtin overflow ---

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-10-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Still LGTM https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Also LGTM, sorry for not responding earlier. I agree with the minor suggestions of @steakhal . https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Donát Nagy via cfe-commits
@@ -16,21 +16,93 @@ #include "clang/Basic/Builtins.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" +#include "clang/StaticAnalyzer/Checkers/Taint.h" #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h"

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output text \ +// RUN: -verify %s + +void test_no_overflow_note(int a, int b) +{ + int res; + + if (__builtin_add_overflow(a, b, &res)) // expected-note {{Assuming overflow does not happen}} -

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
@@ -50,6 +122,107 @@ class BuiltinFunctionChecker : public Checker { } // namespace +const NoteTag *BuiltinFunctionChecker::createBuiltinNoOverflowNoteTag( +CheckerContext &C, bool bothFeasible, SVal Arg1, SVal Arg2, +SVal Result) const { + return C.getNoteTag([Resul

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
@@ -50,6 +122,107 @@ class BuiltinFunctionChecker : public Checker { } // namespace +const NoteTag *BuiltinFunctionChecker::createBuiltinNoOverflowNoteTag( +CheckerContext &C, bool bothFeasible, SVal Arg1, SVal Arg2, +SVal Result) const { + return C.getNoteTag([Resul

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
@@ -50,6 +122,107 @@ class BuiltinFunctionChecker : public Checker { } // namespace +const NoteTag *BuiltinFunctionChecker::createBuiltinNoOverflowNoteTag( +CheckerContext &C, bool bothFeasible, SVal Arg1, SVal Arg2, +SVal Result) const { + return C.getNoteTag([Resul

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,157 @@ +// RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -verify %s \ +// RUN: -analyzer-checker=core,debug.ExprInspection + +#define __UINT_MAX__ (__INT_MAX__ * 2U + 1U) +#define __INT_MIN__ (-__INT_MAX__ - 1) + +void clang_analyzer_dump_int(int); +void cla

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
@@ -50,6 +122,107 @@ class BuiltinFunctionChecker : public Checker { } // namespace +const NoteTag *BuiltinFunctionChecker::createBuiltinNoOverflowNoteTag( +CheckerContext &C, bool bothFeasible, SVal Arg1, SVal Arg2, steakhal wrote: ```suggestion Che

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output text \ +// RUN: -verify %s + +void test_no_overflow_note(int a, int b) +{ + int res; + + if (__builtin_add_overflow(a, b, &res)) // expected-note {{Assuming overflow does not happen}} -

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
@@ -16,21 +16,93 @@ #include "clang/Basic/Builtins.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" +#include "clang/StaticAnalyzer/Checkers/Taint.h" #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h"

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
@@ -327,6 +327,8 @@ Static Analyzer New features +- Now CSA models `__builtin_*_overflow` functions. steakhal wrote: ```suggestion - Now CSA models `__builtin_*_overflow` functions. (#GH102602) ``` https://github.com/llvm/llvm-project/pull/10260

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Looks fantastic! I have no functional remarks. I only sprinkled it with some nits, but other than those it's perfect. It's already good, I'll let you decide if you want to do the final touches or not as those may be more subjective suggest

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-30 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,157 @@ +// RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -verify %s \ +// RUN: -analyzer-checker=core,debug.ExprInspection + +#define __UINT_MAX__ (__INT_MAX__ * 2U + 1U) +#define __INT_MIN__ (-__INT_MAX__ - 1) + +void clang_analyzer_dump_int(int); +void cla

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-28 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: gentle ping https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-12 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 7b4f999b39f4308cab253204e6be41ea7a70f695 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 01/10] clang/csa: add initial support for builtin overflow ---

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-12 Thread Pavel Skripkin via cfe-commits
@@ -16,21 +16,93 @@ #include "clang/Basic/Builtins.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" +#include "clang/StaticAnalyzer/Checkers/Taint.h" #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h"

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-12 Thread Donát Nagy via cfe-commits
@@ -16,21 +16,93 @@ #include "clang/Basic/Builtins.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" +#include "clang/StaticAnalyzer/Checkers/Taint.h" #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h"

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-12 Thread Donát Nagy via cfe-commits
@@ -327,6 +327,8 @@ Static Analyzer New features +- Now CSA models `builtin_*_overflow` functions. NagyDonat wrote: ```suggestion - Now CSA models `__builtin_*_overflow` functions. ``` https://github.com/llvm/llvm-project/pull/102602 ___

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I re-reviewed the commit and added two very minor remarks, otherwise LGTM. https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-11 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: Hello! Is there anything else that stops this PR? Thanks! https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-03 Thread Pavel Skripkin via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-03 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 7b4f999b39f4308cab253204e6be41ea7a70f695 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 1/9] clang/csa: add initial support for builtin overflow --- ..

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-03 Thread Donát Nagy via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-03 Thread Pavel Skripkin via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-03 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-03 Thread Donát Nagy via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-02 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 7b4f999b39f4308cab253204e6be41ea7a70f695 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 1/8] clang/csa: add initial support for builtin overflow --- ..

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-02 Thread Pavel Skripkin via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-02 Thread Donát Nagy via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-02 Thread Pavel Skripkin via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-02 Thread Balazs Benics via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-02 Thread Donát Nagy via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-09-01 Thread Pavel Skripkin via cfe-commits
@@ -0,0 +1,157 @@ +// RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -verify %s \ +// RUN: -analyzer-checker=core,debug.ExprInspection + +#define __UINT_MAX__ (__INT_MAX__ * 2U + 1U) +#define __INT_MIN__ (-__INT_MAX__ - 1) + +void clang_analyzer_dump_int(int); +void cla

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-31 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,157 @@ +// RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -verify %s \ +// RUN: -analyzer-checker=core,debug.ExprInspection + +#define __UINT_MAX__ (__INT_MAX__ * 2U + 1U) +#define __INT_MIN__ (-__INT_MAX__ - 1) + +void clang_analyzer_dump_int(int); +void cla

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-31 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-31 Thread Balazs Benics via cfe-commits
@@ -50,6 +118,75 @@ class BuiltinFunctionChecker : public Checker { } // namespace +std::pair +BuiltinFunctionChecker::checkOverflow(CheckerContext &C, SVal RetVal, + QualType Res) const { + ProgramStateRef State = C.getState(); + SValBu

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-31 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Looks really good. I only had some notes w.r.t. note tags. https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-31 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: gentle ping https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-16 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: Oh, sorry for ping then. PR is not urgent at all. Have a fun vacation! =) https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-16 Thread Balazs Benics via cfe-commits
steakhal wrote: I'm on vacation for some time now. Maybe others can chim in. Should I ping someone? https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-16 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: Could you, please, check the lattest vestion, if you have time? https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-13 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 7b4f999b39f4308cab253204e6be41ea7a70f695 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 1/7] clang/csa: add initial support for builtin overflow --- ..

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-13 Thread Pavel Skripkin via cfe-commits
pskrgag wrote: > Try using the Github merge workflow to avoid doing force-pushes. Those are > destructive for inline comments done for the PR. On force-push, GH can't > follow to which line it should migrate the existing inline comments, thus > drops them. > Sorry again for fp =(. I am getti

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-13 Thread Balazs Benics via cfe-commits
steakhal wrote: Try using the Github merge workflow to avoid doing force-pushes. Those are destructive for inline comments done for the PR. On force-push, GH can't follow to which line it should migrate the existing inline comments, thus drops them. You should just do a fetch main, merge main,

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-13 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-13 Thread Donát Nagy via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Pavel Skripkin via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 7b4f999b39f4308cab253204e6be41ea7a70f695 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 1/6] clang/csa: add initial support for builtin overflow --- ..

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Pavel Skripkin via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Donát Nagy via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 7b4f999b39f4308cab253204e6be41ea7a70f695 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 1/5] clang/csa: add initial support for builtin overflow --- ..

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-12 Thread Donát Nagy via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-11 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 7b4f999b39f4308cab253204e6be41ea7a70f695 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 1/4] clang/csa: add initial support for builtin overflow --- ..

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-11 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 3364284d87035eaac9662d345d4ddee2714f8fd7 a928600fcf613ff1f85fa1e5093c7973d4b8cfb8 --e

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-11 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 3e0fcffa8fbea5f89ab927fd897c451bcafd8e5e Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 1/4] clang/csa: add initial support for builtin overflow --- ..

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-11 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 3e0fcffa8fbea5f89ab927fd897c451bcafd8e5e Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 1/3] clang/csa: add initial support for builtin overflow --- ..

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-11 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag deleted https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-10 Thread Pavel Skripkin via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-09 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-09 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag deleted https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-09 Thread Pavel Skripkin via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-09 Thread Pavel Skripkin via cfe-commits
@@ -50,6 +101,44 @@ class BuiltinFunctionChecker : public Checker { } // namespace +void BuiltinFunctionChecker::HandleOverflowBuiltin(const CallEvent &Call, + CheckerContext &C, +

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-09 Thread Pavel Skripkin via cfe-commits
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/102602 >From 3e0fcffa8fbea5f89ab927fd897c451bcafd8e5e Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 9 Aug 2024 14:37:47 +0300 Subject: [PATCH 1/2] clang/csa: add initial support for builtin overflow --- ..

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-09 Thread Pavel Skripkin via cfe-commits
@@ -278,6 +278,23 @@ int *mallocRegion(void) { return mem; } +int *custom_calloc(size_t a, size_t b) { + size_t res; + if (__builtin_mul_overflow(a, b, &res)) +return 0; + + return malloc(res); +} + +int *mallocRegionOverflow(void) { + int *mem = (int*)custom_calloc(

[clang] [analyzer] Model overflow builtins (PR #102602)

2024-08-09 Thread Pavel Skripkin via cfe-commits
@@ -21,16 +21,67 @@ #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] [analyzer] Model overflow builtins (PR #102602)

2024-08-09 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/102602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits