diff options
author | Mansour Moufid <mansourmoufid@gmail.com> | 2014-10-19 12:36:46 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-02 11:54:42 -0500 |
commit | 3ab2c865bfb78e50f7c67c71144fbed37a7b4478 (patch) | |
tree | 192a9f8db4e08b4def6d2439994dbd092dd2208a /scripts/coccinelle | |
parent | 533790ca7727d6112ab6d6b80a284fcbe8709712 (diff) | |
download | tor-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.cocci | 7 |
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; |