asn1c icon indicating copy to clipboard operation
asn1c copied to clipboard

Compilation of Information Objet Set definition fails

Open tagenefiko opened this issue 5 years ago • 2 comments

Hello,

When I try to compile a file containing Information Object Class and Information Objet Set definitions, I get the following error:

FATAL: Unsupported type ObjectDescriptor for value _message_1_
FATAL: Cannot compile "Message" (20:1) at line 19
FATAL: Cannot compile "Message" (20:1) at line 19

A compilation error occurs when there is more than one element in the set. If comment out all the elements except one, the compilation will be successful:

MessagePDUs MSGPDU ::= {
      message1
    -- | message2
}

ASN.1 file attached. Please help solve the problem.

Message.txt

tagenefiko avatar Feb 28 '20 14:02 tagenefiko

Hi @tagenefiko,

MSGPDU ::= CLASS {
    &id ObjectDescriptor UNIQUE,
    &Data
}

The asn1c does not support ObjectDescriptor as an id type in Information Object Class. It does support INTEGER, ENUMERATED, OBJECT IDENTIFIER and RELATIVE-OID.

https://github.com/vlm/asn1c/blob/fdb68ce2782423ce38caf84f28441d1b0776e9ee/libasn1compiler/asn1c_ioc.c#L119-L151

The fact that it compiles it when you comment out message2 is probably a bug as in this case the emit_ioc_value function is not called at all.

velichkov avatar Feb 28 '20 17:02 velichkov

Hi @velichkov, Thank you for your quick response.

Please help me navigate the code. Which program modules need to be edited to implement support of the required type as an id type in Information Object Class.

tagenefiko avatar Mar 02 '20 16:03 tagenefiko