aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/compiler/diameter_forms.hrl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/diameter/src/compiler/diameter_forms.hrl')
-rw-r--r--lib/diameter/src/compiler/diameter_forms.hrl7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/diameter/src/compiler/diameter_forms.hrl b/lib/diameter/src/compiler/diameter_forms.hrl
index d93131df34..4cd86c32aa 100644
--- a/lib/diameter/src/compiler/diameter_forms.hrl
+++ b/lib/diameter/src/compiler/diameter_forms.hrl
@@ -21,6 +21,13 @@
%% Macros used when building abstract code.
%%
+%% Generated functions that could have no generated clauses will have
+%% a trailing ?BADARG clause that should never execute as called
+%% by diameter.
+-define(BADARG(N), {?clause, [?VAR('_') || _ <- lists:seq(1,N)],
+ [],
+ [?APPLY(erlang, error, [?ATOM(badarg)])]}).
+
%% Form tag with line number.
-define(F(T), T, ?LINE).
%% Yes, that's right. The replacement is to the first unmatched ')'.