Hi, I have just started to use Coccinelle for my final year BTech project
and I have a question,
The code i want to patch depends upon some conditions. e.g. replace any
array[SIZE] having size > 100 with an array[original_size/2]. See, I don't
want to replace ALL array[size], but only when size>100. So, how do i
compare a constant from an expression (here in example SIZE) to a value
(here in example - 100 ) and perform patching depending on that condition
only?
I guess I can get all array and their SIZE in python script and compare
them, but then i don't know how to filter the selected arrays[] and send it
to another rule to perform patching. Please suggest how can I proceed.

Thank You,
Utsav Patel
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to