aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_constructed_per.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-01-23 12:44:20 +0100
committerBjörn Gustavsson <[email protected]>2014-01-24 16:24:56 +0100
commit70cda04e6132a20ce1663bed5a8d7345a87103f2 (patch)
tree3a12128282c76dc7458137a508e3ee0f04564bc3 /lib/asn1/src/asn1ct_constructed_per.erl
parentaaa4ea283b2b7dad74fdcdd5963558e9d03d80b0 (diff)
downloadotp-70cda04e6132a20ce1663bed5a8d7345a87103f2.tar.gz
otp-70cda04e6132a20ce1663bed5a8d7345a87103f2.tar.bz2
otp-70cda04e6132a20ce1663bed5a8d7345a87103f2.zip
Fix open types
Diffstat (limited to 'lib/asn1/src/asn1ct_constructed_per.erl')
-rw-r--r--lib/asn1/src/asn1ct_constructed_per.erl22
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/asn1/src/asn1ct_constructed_per.erl b/lib/asn1/src/asn1ct_constructed_per.erl
index f2509d1324..ed3f6f886e 100644
--- a/lib/asn1/src/asn1ct_constructed_per.erl
+++ b/lib/asn1/src/asn1ct_constructed_per.erl
@@ -450,8 +450,13 @@ dec_objset_default(N, C, LeadingAttr, false) ->
"{value,Bytes},"
"{unique_name_and_value,",{asis,LeadingAttr},",Id}}}).",nl,nl]);
dec_objset_default(N, _, _, true) ->
- emit([{asis,N},"(Bytes, Id) ->",nl,
- "Bytes.",nl,nl]).
+ emit([{asis,N},"(Bytes, Id) ->",nl|
+ case asn1ct:use_legacy_types() of
+ false ->
+ ["{asn1_OPENTYPE,Bytes}.",nl,nl];
+ true ->
+ ["Bytes.",nl,nl]
+ end]).
dec_objset_1(Erule, N, {Id,Obj}, RestFields, Typename) ->
emit([{asis,N},"(Bytes, ",{asis,Id},") ->",nl]),
@@ -1069,8 +1074,17 @@ enc_objset_imm(Erule, Component, ObjSet, RestFieldNames, Extensible) ->
enc_obj(Erule, Obj, RestFieldNames, Aligned)] ||
{Key,Obj} <- ObjSet] ++
[['_',case Extensible of
- false -> E;
- true -> {put_bits,{var,"Val"},binary,[1]}
+ false ->
+ E;
+ true ->
+ case asn1ct:use_legacy_types() of
+ false ->
+ {call,per_common,open_type_to_binary,
+ [{var,"Val"}]};
+ true ->
+ {call,per_common,legacy_open_type_to_binary,
+ [{var,"Val"}]}
+ end
end]]}].
enc_obj(Erule, Obj, RestFieldNames0, Aligned) ->