aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-02-18 13:59:24 +0100
committerBjörn Gustavsson <[email protected]>2013-02-18 13:59:24 +0100
commitb31843c0cdfe31a1a81f5c11b9dd288c120d9da5 (patch)
tree9552dc2bd7210a0c6e1a5a597a50fdfc8f33e8c9 /lib/asn1/src/asn1ct_gen.erl
parent1c1b36997d766428e8213217d0700d9a5c72de0c (diff)
parent71c653f463069d1ab4ddd502a13c4171188253f9 (diff)
downloadotp-b31843c0cdfe31a1a81f5c11b9dd288c120d9da5.tar.gz
otp-b31843c0cdfe31a1a81f5c11b9dd288c120d9da5.tar.bz2
otp-b31843c0cdfe31a1a81f5c11b9dd288c120d9da5.zip
Merge branch 'bjorn/asn1/bug-fixes/OTP-10853'
* bjorn/asn1/bug-fixes/OTP-10853: asn1ct: Eliminate use of obsolete size/1 Eliminate use of obsolete size/1 in generated code BER: Fix broken table constraints inside a SET OF/SEQUENCE OF Smoke test the 'der' option der: Correct code generation for checking of empty sets per,uper: Fix breakage of compilation of InformationFramework Add NullTest asn1_SUITE: Shorten the path to case-specific directory asn1_SUITE: Don't add priv_dir to the code path asn1 tests: Remove obsolete duplicates of ASN.1 specs
Diffstat (limited to 'lib/asn1/src/asn1ct_gen.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index ebc52df1d9..76c4182160 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -657,9 +657,13 @@ gen_check_sof(Name,SOF,Type) ->
end,
emit({" ",{asis,NewName},"(DVs,Vs).",nl,nl}).
+gen_check_sequence(Name, []) ->
+ emit([{asis,ensure_atom(Name)},"(_,_) ->",nl,
+ " throw(badval).",nl,nl]);
gen_check_sequence(Name,Components) ->
emit([{asis,ensure_atom(Name)},"(DefaultValue,Value) ->",nl]),
gen_check_sequence(Name,Components,1).
+
gen_check_sequence(Name,[#'ComponentType'{name=N,typespec=Type}|Cs],Num) ->
InnerType = get_inner(Type#type.def),
NthDefV = ["element(",Num+1,",DefaultValue)"],
@@ -671,9 +675,7 @@ gen_check_sequence(Name,[#'ComponentType'{name=N,typespec=Type}|Cs],Num) ->
_ ->
emit({",",nl}),
gen_check_sequence(Name,Cs,Num+1)
- end;
-gen_check_sequence(_,[],_) ->
- ok.
+ end.
gen_check_choice(Name,CList=[#'ComponentType'{}|_Cs]) ->
emit([{asis,ensure_atom(Name)},"({Id,DefaultValue},{Id,Value}) ->",nl]),