summaryrefslogtreecommitdiff
path: root/scripts/coccinelle
diff options
context:
space:
mode:
authorMansour Moufid <mansourmoufid@gmail.com>2014-10-19 12:36:46 -0400
committerNick Mathewson <nickm@torproject.org>2014-11-02 11:54:42 -0500
commit3ab2c865bfb78e50f7c67c71144fbed37a7b4478 (patch)
tree192a9f8db4e08b4def6d2439994dbd092dd2208a /scripts/coccinelle
parent533790ca7727d6112ab6d6b80a284fcbe8709712 (diff)
downloadtor-3ab2c865bfb78e50f7c67c71144fbed37a7b4478.tar.gz
tor-3ab2c865bfb78e50f7c67c71144fbed37a7b4478.zip
Add a rule to the calloc semantic patch for argument ordering.
Diffstat (limited to 'scripts/coccinelle')
-rw-r--r--scripts/coccinelle/calloc.cocci7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/coccinelle/calloc.cocci b/scripts/coccinelle/calloc.cocci
index df0b61de06..fbda88e538 100644
--- a/scripts/coccinelle/calloc.cocci
+++ b/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;