mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-14 17:43:34 +08:00
This patch adds a workflow to run coccinelle scripts against our codebase. This can be used to find errors in the code base. The initial patch adds a check to find unbalanced heap_form_tuple heap_freetuple occurances. https://coccinelle.gitlabpages.inria.fr/website/
30 lines
475 B
Plaintext
30 lines
475 B
Plaintext
// find heap_form_tuple with missing heap_freetuple calls
|
|
@ heap_form_tuple @
|
|
identifier tuple;
|
|
position p;
|
|
@@
|
|
|
|
tuple@p = heap_form_tuple(...);
|
|
|
|
@safelist@
|
|
expression tuple;
|
|
position heap_form_tuple.p;
|
|
@@
|
|
|
|
tuple@p = heap_form_tuple(...);
|
|
...
|
|
(
|
|
return tuple;
|
|
|
|
|
heap_freetuple(tuple)
|
|
|
|
|
HeapTupleGetDatum(tuple)
|
|
)
|
|
@depends on !safelist@
|
|
expression tuple;
|
|
position heap_form_tuple.p;
|
|
@@
|
|
|
|
+ /* heap_form_tuple with missing heap_freetuple call */
|
|
tuple@p = heap_form_tuple(...);
|