diff options
author | Björn Gustavsson <[email protected]> | 2017-02-28 10:38:01 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-03-14 09:47:40 +0100 |
commit | 1831c36cc0d7c98917ae3bd274071c9c450a9c02 (patch) | |
tree | 3df94e8fd33afff20d2069603e4c01c729656e8e | |
parent | 3334c0c7b831ecf47738c713fd764eef891a298a (diff) | |
download | otp-1831c36cc0d7c98917ae3bd274071c9c450a9c02.tar.gz otp-1831c36cc0d7c98917ae3bd274071c9c450a9c02.tar.bz2 otp-1831c36cc0d7c98917ae3bd274071c9c450a9c02.zip |
asn1ct_gen_per: Fix broken dialyzer suppression function
ce431409d0daba broke generation of dialyzer suppressions
for per and uper.
While we are it, add type tests to asn1ct_func:is_used/1
to avoid similar problems in the future.
-rw-r--r-- | lib/asn1/src/asn1ct_func.erl | 2 | ||||
-rw-r--r-- | lib/asn1/src/asn1ct_gen_per.erl | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/asn1/src/asn1ct_func.erl b/lib/asn1/src/asn1ct_func.erl index 0cd72acf9d..016161fcaf 100644 --- a/lib/asn1/src/asn1ct_func.erl +++ b/lib/asn1/src/asn1ct_func.erl @@ -65,7 +65,7 @@ generate(Fd) -> Funcs = sofs:to_external(Funcs0), ok = file:write(Fd, Funcs). -is_used({_,_,_}=MFA) -> +is_used({M,F,A}=MFA) when is_atom(M), is_atom(F), is_integer(A) -> req({is_used,MFA}). diff --git a/lib/asn1/src/asn1ct_gen_per.erl b/lib/asn1/src/asn1ct_gen_per.erl index 9671a566bf..79e96c1aab 100644 --- a/lib/asn1/src/asn1ct_gen_per.erl +++ b/lib/asn1/src/asn1ct_gen_per.erl @@ -42,8 +42,12 @@ %% Generate ENCODING ****************************** %%****************************************x -dialyzer_suppressions(Erules) -> - case asn1ct_func:is_used({Erules,complete,1}) of +dialyzer_suppressions(#gen{erule=per,aligned=Aligned}) -> + Mod = case Aligned of + false -> uper; + true -> per + end, + case asn1ct_func:is_used({Mod,complete,1}) of false -> ok; true -> |