diff options
Diffstat (limited to 'cocci/dns_message_create.spatch')
-rw-r--r-- | cocci/dns_message_create.spatch | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/cocci/dns_message_create.spatch b/cocci/dns_message_create.spatch new file mode 100644 index 0000000..bab6d58 --- /dev/null +++ b/cocci/dns_message_create.spatch @@ -0,0 +1,84 @@ +@@ +statement S; +expression V; +@@ + +- V = + dns_message_create(...); +- if (V != ISC_R_SUCCESS) S + +@@ +statement S1, S2; +expression V; +@@ + +- V = + dns_message_create(...); +- if (V == ISC_R_SUCCESS) + S1 +- else S2 + +@@ +expression V; +@@ + +- V = + dns_message_create(...); +- check_result(V, ...); + +@@ +@@ + +- CHECK( + dns_message_create(...) +- ) + ; + +@@ +@@ + +- DO(..., + dns_message_create(...) +- ) + ; + +@@ +@@ + +- RETERR( + dns_message_create(...) +- ) + ; + +@@ +expression V; +@@ + +- V = + dns_message_create(...); +- assert_int_equal(V, ISC_R_SUCCESS); + +@@ +expression V; +@@ + +- V = + dns_message_create(...); +- CHECK(..., V); + +@@ +expression V; +statement S; +@@ + +- V = + dns_message_create(...); +- if (ISC_UNLIKELY(V != ISC_R_SUCCESS)) S + +@@ +expression V; +@@ + +- V = + dns_message_create(...); +- RUNTIME_CHECK(V == ISC_R_SUCCESS); |