From 956a11631750ad3ea1d8d191f1e202b2d68db194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 6 May 2014 08:31:02 +0200 Subject: (U)PER: Optimize handling of named BIT STRING with a lower zero bound If a named BIT STRING has a lower size bound of 0, treat it the same way as if there was no constraint for the purposes of trailing zero bits. That change will eliminate a dialyzer warning. --- lib/asn1/src/asn1ct_imm.erl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/asn1/src') diff --git a/lib/asn1/src/asn1ct_imm.erl b/lib/asn1/src/asn1ct_imm.erl index 321d32ef17..7320e7f284 100644 --- a/lib/asn1/src/asn1ct_imm.erl +++ b/lib/asn1/src/asn1ct_imm.erl @@ -175,6 +175,8 @@ per_enc_bit_string(Val0, NNL0, Constraint0, Aligned) -> ToBs = case ExtraArgs of [] -> {call,per_common,bs_drop_trailing_zeroes,[Val]}; + [0] -> + {call,per_common,bs_drop_trailing_zeroes,[Val]}; [Lower] -> {call,per_common,adjust_trailing_zeroes,[Val,Lower]} end, @@ -203,6 +205,7 @@ per_enc_legacy_bit_string(Val0, NNL0, Constraint0, Aligned) -> Constraint = effective_constraint(bitstring, Constraint0), ExtraArgs = case constr_min_size(Constraint) of no -> []; + 0 -> []; Lb -> [Lb] end, B ++ [{'try', -- cgit v1.2.3