aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-05-28 06:49:38 +0200
committerBjörn Gustavsson <[email protected]>2013-08-30 10:13:16 +0200
commit060bd359237cdb629abba03620323c0ed8084910 (patch)
tree77131a0c11a899ec9c3d13a691edbeb68b181596 /lib/asn1/src/asn1ct_gen_per_rt2ct.erl
parentb2b81e94855075c8e7cbd7f61d62900914d72222 (diff)
downloadotp-060bd359237cdb629abba03620323c0ed8084910.tar.gz
otp-060bd359237cdb629abba03620323c0ed8084910.tar.bz2
otp-060bd359237cdb629abba03620323c0ed8084910.zip
Refactor encoding of REAL
To facilitate optimizing PER encoding using an intermediate format, we must change asn1rtt_real_common:encode_real/1 so that it only returns the encoded binary.
Diffstat (limited to 'lib/asn1/src/asn1ct_gen_per_rt2ct.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen_per_rt2ct.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/asn1/src/asn1ct_gen_per_rt2ct.erl b/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
index 012d54e7a1..6c0bd95eef 100644
--- a/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
+++ b/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
@@ -122,9 +122,11 @@ emit_enc_real(Erules, Real) ->
asn1ct_name:new(tmpval),
asn1ct_name:new(tmplen),
emit(["begin",nl,
- "{",{curr,tmpval},com,{curr,tmplen},"} = ",
+ {curr,tmpval}," = ",
{call,real_common,encode_real,[Real]},com,nl,
- "[",{call,Erules,encode_length,[{curr,tmplen}]},",",nl,
+ {curr,tmplen}," = ",
+ {call,erlang,byte_size,[{curr,tmpval}]},com,nl,
+ "[",{call,Erules,encode_length,[{curr,tmplen}]},com,nl,
{call,Erules,octets_to_complete,
[{curr,tmplen},{curr,tmpval}]},"]",nl,
"end"]).