aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-11-13 09:29:57 +0100
committerBjörn Gustavsson <[email protected]>2012-11-22 17:23:12 +0100
commit4a80c771f6a4e04fd4e7f7990e9d9a118ab2d689 (patch)
tree2d8963c20339f8b1916e6d63ee0341ad48157b15 /lib/asn1/src
parent0481bd15d660853076036c09d7adcce1de523a23 (diff)
downloadotp-4a80c771f6a4e04fd4e7f7990e9d9a118ab2d689.tar.gz
otp-4a80c771f6a4e04fd4e7f7990e9d9a118ab2d689.tar.bz2
otp-4a80c771f6a4e04fd4e7f7990e9d9a118ab2d689.zip
Make the specialized decodes work with the 'nif' option
Diffstat (limited to 'lib/asn1/src')
-rw-r--r--lib/asn1/src/asn1ct_gen.erl15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index 64a3555f62..4a7843166b 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -1131,7 +1131,7 @@ gen_decode_partial_incomplete(Erule) when Erule == ber;Erule==ber_bin;
" {error,{asn1,Reason}};",nl,
" Result ->",nl,
" {ok,Result}",nl,
- " end.",nl,nl])
+ " end"])
end,
emit(["decode_partial_incomplete(Type,Data0,",
"Pattern) ->",nl]),
@@ -1141,12 +1141,17 @@ gen_decode_partial_incomplete(Erule) when Erule == ber;Erule==ber_bin;
" case catch decode_partial_inc_disp(Type,",
"Data) of",nl]),
EmitCaseClauses(),
- emit(["decode_part(Type,Data0) ->",nl]),
+ emit([".",nl,nl]),
+ emit(["decode_part(Type, Data0) "
+ "when is_binary(Data0) ->",nl]),
emit([" case catch decode_inc_disp(Type,element(1,"
"?RT_BER:decode(Data0",nif_parameter(),"))) of",nl]),
-% " {Data,_RestBin} = ?RT_BER:decode(Data0),",nl,
-% " case catch decode_inc_disp(Type,Data) of",nl]),
- EmitCaseClauses();
+ EmitCaseClauses(),
+ emit([";",nl]),
+ emit(["decode_part(Type, Data0) ->",nl]),
+ emit([" case catch decode_inc_disp(Type, Data0) of",nl]),
+ EmitCaseClauses(),
+ emit([".",nl,nl]);
_ -> ok % add later
end
end;