Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-11 Thread Markus Elfring
>> @display@ >> expression x; >> identifier f; > > You can put f != {likely,unlikely} here. Now I have got a related impression. It seems that such a search pattern extension affects also our unfinished clarification for the desired handling of when constraints by SmPL ellipses. How will this

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-11 Thread Markus Elfring
>> @display@ >> expression x; >> identifier f; > > You can put f != {likely,unlikely} here. I would appreciate to achieve a better understanding how these likeliness annotations can influence the shown source code search approach. > Maybe there will be some false positives when x->f is in a

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-11 Thread Markus Elfring
>> The possibility remains that also your search pattern suggestion will point >> update candidates out at other places than the implementation of the >> mentioned >> function “imx_pd_bind”. > > So many words. So little information. This can also occasionally happen if the search approach is

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-11 Thread Julia Lawall
On Fri, 11 Oct 2019, Markus Elfring wrote: > > And what is the questionable source code place? > > I find implementation details occasionally questionable where checks for > variables > which provide a stored function return value are missing. > The possibility remains that also your search

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-10 Thread Markus Elfring
> And what is the questionable source code place? I find implementation details occasionally questionable where checks for variables which provide a stored function return value are missing. The possibility remains that also your search pattern suggestion will point update candidates out at

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-10 Thread Markus Elfring
>> I would like to detect that a corresponding null pointer check would be >> missing >> (before the data can be used for further data processing). > > * x = kmemdup(...); > ... when != x > ( > x->f > | > f(...,<+...x...+>,...) > ) This analysis approach looks promising in principle. I

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-10 Thread Markus Elfring
I would like to detect that a corresponding null pointer check would be missing (before the data can be used for further data processing). >>> >>> * x = kmemdup(...); >>> ... when != x >>> ( >>> x->f >>> | >>> f(...,<+...x...+>,...) >>> ) >> >> This SmPL search approach does

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-10 Thread Markus Elfring
>> I would like to detect that a corresponding null pointer check would be >> missing >> (before the data can be used for further data processing). > > * x = kmemdup(...); > ... when != x > ( > x->f > | > f(...,<+...x...+>,...) > ) This SmPL search approach does not work as expected for

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-10 Thread Julia Lawall
On Thu, 10 Oct 2019, Markus Elfring wrote: > > Why not just > > > > x = kmemdup(...); > > ... when != x > > I find this SmPL code exclusion specification too generic for the use case. > I would like to detect that a corresponding null pointer check would be > missing > (before the data can be

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-10 Thread Markus Elfring
> Why not just > > x = kmemdup(...); > ... when != x I find this SmPL code exclusion specification too generic for the use case. I would like to detect that a corresponding null pointer check would be missing (before the data can be used for further data processing). Regards, Markus

Re: [Cocci] Software analysis with SmPL around unchecked function calls

2019-10-10 Thread Julia Lawall
On Thu, 10 Oct 2019, Markus Elfring wrote: > Hello, > > I would like to try another source code analysis approach out with > the software combination “Coccinelle 1.0.8-4-g842075f7”. > > @display@ > expression x; > statement is, es; > @@ > ( > *x = kmemdup(...); > |if (...) > *x =