Pārlūkot izejas kodu

Add a rule to the calloc semantic patch for argument ordering.

Mansour Moufid 10 gadi atpakaļ
vecāks
revīzija
3ab2c865bf
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. 7 0
      scripts/coccinelle/calloc.cocci

+ 7 - 0
scripts/coccinelle/calloc.cocci

@@ -8,6 +8,13 @@ constant b;
 - f(a * b)
 + tor_calloc(a, b)
 
+@calloc_arg_order@
+expression a;
+type t;
+@@
+- tor_calloc(sizeof(t), a)
++ tor_calloc(a, sizeof(t))
+
 @realloc_to_reallocarray@
 expression a, b;
 expression p;