Skip to content
Discussion options

You must be logged in to vote

Indeed, that's right. The out param should always be set (explicitly) to True.

To reproduce I created this grammar:

D DEFINITIONS ::=
BEGIN

MyNull ::= NULL

MyChoice ::= CHOICE {
   with-null MyNull
}
END

And generated a test case:

$ asn1scc -Ada -uper -atc foo.asn
$ make

It fails at decoding because as you point out, right now the template generates nothing:

procedure MyNull_Decode_aux(val: out MyNull; bs : in out adaasn1rtl.encoding.Bitstream; result : OUT adaasn1rtl.ASN1_RESULT)
is
    pragma Unreferenced (bs);
    pragma Unreferenced (val);

begin
    null;
end MyNull_Decode_aux;

Instead of null it should generate:

    result := adaasn1rtl.ASN1_RESULT'(Success => true, ErrorCode => 0);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sbenitezb
Comment options

Answer selected by sbenitezb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants