aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-05-06 11:12:22 +0200
committerBjörn Gustavsson <[email protected]>2014-06-05 13:46:28 +0200
commitbf1f64b65555600aaed77dfd7392afcfe55b83b4 (patch)
tree0825e9c652d12a2616d05d3fc25a26407b676c6e /lib
parent956a11631750ad3ea1d8d191f1e202b2d68db194 (diff)
downloadotp-bf1f64b65555600aaed77dfd7392afcfe55b83b4.tar.gz
otp-bf1f64b65555600aaed77dfd7392afcfe55b83b4.tar.bz2
otp-bf1f64b65555600aaed77dfd7392afcfe55b83b4.zip
(U)PER: Fix encoding of a semi-constrained, named INTEGER
The code generator would crash.
Diffstat (limited to 'lib')
-rw-r--r--lib/asn1/src/asn1ct_imm.erl2
-rw-r--r--lib/asn1/test/asn1_SUITE_data/Constraints.py1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1ct_imm.erl b/lib/asn1/src/asn1ct_imm.erl
index 7320e7f284..5191635a81 100644
--- a/lib/asn1/src/asn1ct_imm.erl
+++ b/lib/asn1/src/asn1ct_imm.erl
@@ -1296,6 +1296,8 @@ eval_cond_1({eq,[],[]}) ->
true;
eval_cond_1({eq,I,N}) when is_integer(I), is_integer(N) ->
I =:= N;
+eval_cond_1({ge,I,N}) when is_integer(I), is_integer(N) ->
+ I >= N;
eval_cond_1({lt,I,N}) when is_integer(I), is_integer(N) ->
I < N;
eval_cond_1(_) -> maybe.
diff --git a/lib/asn1/test/asn1_SUITE_data/Constraints.py b/lib/asn1/test/asn1_SUITE_data/Constraints.py
index c3b3aebd6d..1fe658d2e2 100644
--- a/lib/asn1/test/asn1_SUITE_data/Constraints.py
+++ b/lib/asn1/test/asn1_SUITE_data/Constraints.py
@@ -16,6 +16,7 @@ SemiConstrained ::= INTEGER (100..MAX)
NegSemiConstrained ::= INTEGER (-128..MAX)
SemiConstrainedExt ::= INTEGER (42..MAX, ...)
NegSemiConstrainedExt ::= INTEGER (-128..MAX, ...)
+SemiNamed ::= INTEGER {a(100), b(200)} (100..MAX)
-- Extensions --
LongLongExt ::= INTEGER (0..18446744073709551615, ..., -5000..-1)
Range256to65536Ext ::= INTEGER (256..65536, ..., 1000000..9000000)