mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-22 01:59:26 +00:00
Add semantic patch to refactor isc_mempool_create() usage
This commit is contained in:
parent
de123a67d6
commit
33328871a7
49
cocci/isc_mempool_create_cannot_fail.cocci
Normal file
49
cocci/isc_mempool_create_cannot_fail.cocci
Normal file
@ -0,0 +1,49 @@
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
isc_mempool_create(...);
|
||||
- assert_int_equal(V, ISC_R_SUCCESS);
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
isc_mempool_create(...);
|
||||
- check_result(V, ...);
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- CHECK(
|
||||
isc_mempool_create(...)
|
||||
- )
|
||||
;
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- RUNTIME_CHECK(
|
||||
isc_mempool_create(...)
|
||||
- == ISC_R_SUCCESS)
|
||||
;
|
||||
|
||||
@@
|
||||
expression V;
|
||||
statement S;
|
||||
@@
|
||||
|
||||
- V =
|
||||
isc_mempool_create(...);
|
||||
- if (V != ISC_R_SUCCESS) S
|
||||
|
||||
@@
|
||||
statement S;
|
||||
@@
|
||||
|
||||
- if (
|
||||
isc_mempool_create(...)
|
||||
- != ISC_R_SUCCESS) S
|
||||
+ ;
|
Loading…
x
Reference in New Issue
Block a user