On Fri, Mar 31, 2017 at 10:40:33AM -0300, Eduardo Habkost wrote: > On Fri, Mar 31, 2017 at 10:27:44AM -0300, Philippe Mathieu-Daudé wrote: > > Hi, > > > > Eduardo you seem skilled regarding Coccinelle scripts, is it possible to > > write one to find those overflows? > > Probably not. AFAIK, Coccinelle rules are based on local code > syntax only. This means it doesn't know the data type of > expressions like (s->tracks).
I'm surprised by that statement. Coccinelle isn't a text matcher, it's a proper C compiler frontend that parses the all code in the compilation unit. Therefore it must have the type information even for s->tracks. Disclaimer: This should in no way be considered a volunteer offer to write cocci scripts now or at any time in the future :). I'm not fluent in the semantic patch syntax. Stefan
signature.asc
Description: PGP signature