ASN.1. generation with erlc -bber works / erlc -bper - fails

Ingars <[email protected]> Thu, 21 Jan 2016 14:38:50 +0200
Newsgroups gmane.comp.lang.erlang.bugs
Message-ID <CAOoDxe5-01yNqR_kAnjrB4Q51hxD4U_UMN=LrK14cxAeVEjPvg@mail.gmail.com>
--===============0905630758935167283==
Content-Type: multipart/alternative; boundary=089e0122a8827710020529d76277

--089e0122a8827710020529d76277
Content-Type: text/plain; charset=UTF-8

Hi,

I have found an ASN.1 fragment that compiles well with erlc -bber flag but
fails with erlc -bper.

> iri@ubuntu:~/asn$ erlc -bber TEST.asn
  -> works well

> iri@ubuntu:~/asn$ erlc -bper TEST.asn
  -> raises an error
      ------------------------------------------------
      {{badmatch,1799999989},

[{asn1ct_imm,per_enc_constrained,4,[{file,"asn1ct_imm.erl"},{line,1139}]},

{asn1ct_imm,per_enc_integer_1,3,[{file,"asn1ct_imm.erl"},{line,1094}]},
        {asn1ct_imm,'-per_enc_integer/4-lc$^0/1-0-',4,
                    [{file,"asn1ct_imm.erl"},{line,248}]},
        {asn1ct_imm,per_enc_integer,4,[{file,"asn1ct_imm.erl"},{line,248}]},

{asn1ct_gen_per,gen_encode_prim,3,[{file,"asn1ct_gen_per.erl"},{line,121}]},

{asn1ct_gen_per,gen_encode_user,2,[{file,"asn1ct_gen_per.erl"},{line,98}]},
        {asn1ct_gen,pgen_types,5,[{file,"asn1ct_gen.erl"},{line,123}]},
        {asn1ct_gen,pgen_typeorval,4,[{file,"asn1ct_gen.erl"},{line,105}]}]}
      ------------------------------------------------

With ASN.1 -> C compiler
> asn1c -gen-PER TEST.asn
  -> also works well


File TEST.asn:
------------------------
    TEST DEFINITIONS IMPLICIT TAGS ::=
    BEGIN
      Longitude ::= INTEGER
      {
        oneMicrodegreeEast(10),
        oneMicrodegreeWest(-10),
        unavailable(1800000001)
      } (-1799999999..1800000001)
    END
------------------------


Thanks,

Ingars
/////

--089e0122a8827710020529d76277
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div>Hi,<br><br></div>I have found an ASN.1 frag=
ment that compiles well with erlc -bber flag but fails with erlc -bper.<br>=
<br></div>&gt; iri@ubuntu:~/asn$ erlc -bber TEST.asn<br>=C2=A0 -&gt; works =
well<br></div><div><br>&gt; iri@ubuntu:~/asn$ erlc -bper TEST.asn<br>=C2=A0=
 -&gt; raises an error<br><div>=C2=A0 =C2=A0=C2=A0=C2=A0 ------------------=
------------------------------<br>=C2=A0 =C2=A0 =C2=A0 {{badmatch,179999998=
9},<br>=C2=A0 =C2=A0 =C2=A0=C2=A0 [{asn1ct_imm,per_enc_constrained,4,[{file=
,&quot;asn1ct_imm.erl&quot;},{line,1139}]},<br>=C2=A0 =C2=A0 =C2=A0=C2=A0=
=C2=A0 {asn1ct_imm,per_enc_integer_1,3,[{file,&quot;asn1ct_imm.erl&quot;},{=
line,1094}]},<br>=C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 {asn1ct_imm,&#39;-per_enc=
_integer/4-lc$^0/1-0-&#39;,4,<br>=C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [{file,&quo=
t;asn1ct_imm.erl&quot;},{line,248}]},<br>=C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 {=
asn1ct_imm,per_enc_integer,4,[{file,&quot;asn1ct_imm.erl&quot;},{line,248}]=
},<br>=C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 {asn1ct_gen_per,gen_encode_prim,3,[{=
file,&quot;asn1ct_gen_per.erl&quot;},{line,121}]},<br>=C2=A0 =C2=A0 =C2=A0=
=C2=A0=C2=A0 {asn1ct_gen_per,gen_encode_user,2,[{file,&quot;asn1ct_gen_per.=
erl&quot;},{line,98}]},<br>=C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 {asn1ct_gen,pge=
n_types,5,[{file,&quot;asn1ct_gen.erl&quot;},{line,123}]},<br>=C2=A0 =C2=A0=
 =C2=A0=C2=A0=C2=A0 {asn1ct_gen,pgen_typeorval,4,[{file,&quot;asn1ct_gen.er=
l&quot;},{line,105}]}]}<br>=C2=A0 =C2=A0=C2=A0=C2=A0 ----------------------=
--------------------------<br><br>With ASN.1 -&gt; C compiler<br>&gt; asn1c=
 -gen-PER TEST.asn<br></div><div>=C2=A0 -&gt; also works well<br><br></div>=
<div><br><div> File TEST.asn:<br>------------------------<br>=C2=A0=C2=A0=
=C2=A0 TEST DEFINITIONS IMPLICIT TAGS ::=3D<br>=C2=A0=C2=A0=C2=A0 BEGIN<br>=
=C2=A0 =C2=A0 =C2=A0 Longitude ::=3D INTEGER<br>=C2=A0 =C2=A0 =C2=A0 {<br>=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 oneMicrodegreeEast(10),<br>=C2=
=A0 =C2=A0=C2=A0 =C2=A0=C2=A0 oneMicrodegreeWest(-10),<br>=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 unavailable(1800000001)<br>=C2=A0 =C2=A0 =C2=A0=
 } (-1799999999..1800000001)<br>=C2=A0=C2=A0=C2=A0 END<br>-----------------=
-------<br><br><br>Thanks,
<br><br>Ingars<br>/////<br><br></div></div></div></div>

--089e0122a8827710020529d76277--

--===============0905630758935167283==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs

--===============0905630758935167283==--