commit | 02fa646a373aedaf43b946169ccbe31e82d265b5 | [log] [tgz] |
---|---|---|
author | Tim Duesterhus <tim@bastelstu.be> | Wed Sep 15 13:58:48 2021 +0200 |
committer | Willy Tarreau <w@1wt.eu> | Fri Sep 17 17:22:05 2021 +0200 |
tree | 89aded9a77fdfe2f669ba897359ccb8717a328ef | |
parent | 63ee0e4c01b94aee5fc6c6dd98cfc4480ae5ea46 [diff] |
DEV: coccinelle: Add bug_on.cocci This replaces an if + ABORT_NOW() by BUG_ON(). It might change behavior, because BUG_ON will result in a no-op if not enabled.
diff --git a/dev/coccinelle/bug_on.cocci b/dev/coccinelle/bug_on.cocci new file mode 100644 index 0000000..3837879 --- /dev/null +++ b/dev/coccinelle/bug_on.cocci
@@ -0,0 +1,7 @@ +@@ +expression E; +@@ + +- if (E) +- ABORT_NOW(); ++ BUG_ON(E);