diff options
author | Björn Gustavsson <[email protected]> | 2014-05-06 08:31:02 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-06-05 13:46:28 +0200 |
commit | 956a11631750ad3ea1d8d191f1e202b2d68db194 (patch) | |
tree | e17cd32ba0c3cb27f7ad80aab16331a732bbea04 | |
parent | 5faf278c471c1d01456012ce18869716c9714722 (diff) | |
download | otp-956a11631750ad3ea1d8d191f1e202b2d68db194.tar.gz otp-956a11631750ad3ea1d8d191f1e202b2d68db194.tar.bz2 otp-956a11631750ad3ea1d8d191f1e202b2d68db194.zip |
(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.
-rw-r--r-- | lib/asn1/src/asn1ct_imm.erl | 3 |
1 files changed, 3 insertions, 0 deletions
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', |