Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000818Taste[All Projects] ASN.1 Compilerpublic2018-12-06 19:422018-12-09 14:52
Reportercavada@fbk.eu 
Assigned Togmamais 
PrioritynormalSeveritymajorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Summary0000818:

asn1scc generates empty encoders/decoders with ACN additional fields

Description

It seems that asn1scc generates empty code for encoding/decoding functions, for ASN.1 types that are associated to an ACN specification which adds additional fields.

For example:

-- asn.1
T-SomeType ::= SEQUENCE
{
field1 T-MyInteger,
field2 T-MyInteger
}

-- acn
T-SomeType []
{
field1 [size 4, encoding pos-int],
field3 INTEGER [size 5, encoding pos-int],
field2 [size 4, encoding pos-int]
}

Makes the encoding of T-SomeType like this:
flag T_SomeType_ACN_Encode(const T_SomeType* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints)
{
flag ret = TRUE;
ret = bCheckConstraints ? T_SomeType_IsConstraintValid(pVal, pErrCode) : TRUE ;
if (ret) {
// --> Notice the empty body here for the encoding
}

return ret;

}

Similarly for the decoding function.

If instead of having a typed additional field, pattern is used like in:

...
field3 NULL [pattern '00000'B],
...

The encoding/decoding functions get generated correctly.

Steps To Reproduce

See attached file for a complete example.
$> make check
To see the resulting encoding function.

TagsNo tags attached.
Attached Filestgz file icon stm-13-acn.tgz [^] (743 bytes) 2018-12-06 19:42

- Relationships

-  Notes
(0003529)
gmamais (developer)
2018-12-09 14:52

fixed in latest version 4.1.0.4f

Please note that when you insert Integer ACN fields (like field3), then these fields should act as a length determinant of a sizeable type. In this case, the field3 is not used as a length determinant by any other type and for this reason, the encoding and decoding were empty.
I changed the compiler to emit an error when an Integer ACN field is introduced and not used as a length determinant.


- Issue History
Date Modified Username Field Change
2018-12-06 19:42 cavada@fbk.eu New Issue
2018-12-06 19:42 cavada@fbk.eu Status

new => assigned

2018-12-06 19:42 cavada@fbk.eu Assigned To

=> gmamais

2018-12-06 19:42 cavada@fbk.eu File Added: stm-13-acn.tgz
2018-12-09 14:52 gmamais Note Added: 0003529
2018-12-09 14:52 gmamais Status

assigned => resolved

2018-12-09 14:52 gmamais Resolution

open => fixed



Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker