aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen_per.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.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.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen_per.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/asn1/src/asn1ct_gen_per.erl b/lib/asn1/src/asn1ct_gen_per.erl
index 69d9d51bf1..a3c1f01961 100644
--- a/lib/asn1/src/asn1ct_gen_per.erl
+++ b/lib/asn1/src/asn1ct_gen_per.erl
@@ -215,9 +215,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}]},",",
+ {curr,tmplen}," = ",
+ {call,erlang,byte_size,[{curr,tmpval}]},com,nl,
+ "[",{call,Erules,encode_length,[{curr,tmplen}]},com,nl,
{curr,tmpval},"]",nl,
"end"]).