I am working on a patch that manipulates null pointer usage. However the
second rule matches code inside macros which causes issues. Is there a
way to have rule 2 skip macros or rule 1 match against them and thereby
deactivate rule 2?
Cheers
Mitchell
@p_null disable is_null, isnt_null1, is_zero, isnt_zero@
expression *E;
type T;
position p;
T *f;
@@
(
\(E\|f(...)\) == @p NULL
|
\(E\|f(...)\) != @p NULL
|
E =@p NULL
)
@np_null depends on !p_null && !ptr_zero disable is_null, isnt_null1,
is_zero, isnt_zero@
position p;
T g;
expression F;
@@
(
\(F\|g(...)\) == @p
- NULL
+ 0
|
\(F\|g(...)\) != @p
- NULL
+ 0
|
F = @p
- NULL
+ 0
)
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci