Re: [Cocci] [PATCH] coccinelle: misc: add array_size_dup script to detect missed overflow checks

2020-06-17 Thread Markus Elfring
> ( > * size = E1 * E2;@p > | > * size = E1 * E2 * E3;@p > | > * size = E1 * E2 + E3;@p > ) I suggest to reconsider also the order of elements for such a SmPL disjunction. Can a computation like “E2 * E3” also be matched by the expression metavariable “E2” alone? Regards, Markus

Re: [Cocci] [PATCH] coccinelle: misc: Add array_size_dup script to detect missed overflow checks

2020-06-17 Thread Markus Elfring
I propose once more to avoid a typo in the previous patch subject. … > ( > - size = E1 * E2; > + size = array_size(E1, E2); > | > - size = E1 * E2 * E3; > + size = array3_size(E1, E2, E3); > | > - size = E1 * E2 + E3; > + size = struct_size(E1, E2, E3); > ) How do you think about to use SmPL dis

Re: [Cocci] [PATCH] coccinelle: misc: add array_size_dup script to detect missed overflow checks

2020-06-15 Thread Markus Elfring
I suggest to avoid a typo in the previous patch subject. … > +virtual context > +virtual report > +virtual org +virtual context, report, org Is such a SmPL code variant more succinct? … > +@as_next@ > +expression subE1 <= as.E1; > +expression as.E1; … I propose to reduce the repetition of th