Re: [Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-23 Thread Pierrick Philippe
On 22/03/2023 19:19, David Malcolm wrote: On Tue, 2023-03-21 at 09:21 +0100, Pierrick Philippe wrote: [stripping] In fact, this could be done directly by the analyzer, and only calling state machine APIs for loop handling which still has not reached such a fixed point in their program state for

Re: [Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-22 Thread David Malcolm via Gcc
On Tue, 2023-03-21 at 11:01 +0100, Shengyu Huang wrote: > Hi Dave, > > > I implemented my own approach, with a "widening_svalue" subclass of > > symbolic value.  This is widening in the Abstract Interpretation > > sense, > > (as opposed to the bitwise operations sense): if I see multiple > > value

Re: [Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-22 Thread David Malcolm via Gcc
On Tue, 2023-03-21 at 09:21 +0100, Pierrick Philippe wrote: > On 21/03/2023 00:30, David Malcolm wrote: > > On Mon, 2023-03-20 at 13:28 +0100, Pierrick Philippe wrote: > > > Hi everyone, > > > > > > I'm still playing around with the analyzer, and wanted to have a > > > look > > > at > > > loop han

Re: [Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-21 Thread Shengyu Huang via Gcc
Hi Dave, > On 21 Mar 2023, at 00:30, David Malcolm via Gcc wrote: > > I implemented my own approach, with a "widening_svalue" subclass of > symbolic value. This is widening in the Abstract Interpretation sense, > (as opposed to the bitwise operations sense): if I see multiple values > on succes

Re: [Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-21 Thread Shengyu Huang via Gcc
Hi Dave, > I implemented my own approach, with a "widening_svalue" subclass of > symbolic value. This is widening in the Abstract Interpretation sense, > (as opposed to the bitwise operations sense): if I see multiple values > on successive iterations, the widening_svalue tries to simulate that w

Re: [Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-21 Thread Pierrick Philippe
On 21/03/2023 00:30, David Malcolm wrote: On Mon, 2023-03-20 at 13:28 +0100, Pierrick Philippe wrote: Hi everyone, I'm still playing around with the analyzer, and wanted to have a look at loop handling. I'm using a build from /trunk/ branch (/20230309/). Here is my analyzed code: ''' 1| #incl

Re: [Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-20 Thread David Malcolm via Gcc
On Mon, 2023-03-20 at 13:28 +0100, Pierrick Philippe wrote: > Hi everyone, > > I'm still playing around with the analyzer, and wanted to have a look > at > loop handling. > I'm using a build from /trunk/ branch (/20230309/). > > Here is my analyzed code: > > ''' > 1| #include > 2| int main(voi

[Static Analyzer] Loop handling - False positive for malloc-sm

2023-03-20 Thread Pierrick Philippe
Hi everyone, I'm still playing around with the analyzer, and wanted to have a look at loop handling. I'm using a build from /trunk/ branch (/20230309/). Here is my analyzed code: ''' 1| #include 2| int main(void) { 3|    void * ptr = malloc(sizeof(int)); 4|    for (int i = 0; i < 10; i++) {