• Bi-Ruei, Chiu's avatar
    Fix incorrect UPER encoding for empty extensible SEQUENCE in 38.331 · f12568d6
    Bi-Ruei, Chiu authored
    For empty extensible SEQUENCE type, e.g.
    
      searchSpaceType              CHOICE {
        common                       SEQUENCE {
          dci-Format0-0-AndFormat1-0     SEQUENCE {
            ...
          }                                                           OPTIONAL,   -- Need R
          dci-Format2-0                SEQUENCE {
            nrofCandidates-SFI           SEQUENCE {
              aggregationLevel1            ENUMERATED {n1, n2}        OPTIONAL,   -- Need R
              aggregationLevel2            ENUMERATED {n1, n2}        OPTIONAL,   -- Need R
              aggregationLevel4            ENUMERATED {n1, n2}        OPTIONAL,   -- Need R
              aggregationLevel8            ENUMERATED {n1, n2}        OPTIONAL,   -- Need R
              aggregationLevel16           ENUMERATED {n1, n2}        OPTIONAL    -- Need R
            },
            ...
          }                                                         OPTIONAL,   -- Need R
          dci-Format2-1                SEQUENCE {
            ...
          }                                                         OPTIONAL,   -- Need R
          dci-Format2-2                SEQUENCE {
            ...
          }                                                         OPTIONAL,   -- Need R
          dci-Format2-3                SEQUENCE {
            dummy1                       ENUMERATED {sl1, sl2, sl4, sl5, sl8, sl10, sl16, sl20}    OPTIONAL,   -- Cond Setup
            dummy2                       ENUMERATED {n1, n2},
            ...
          }                                                         OPTIONAL    -- Need R
        },
        ue-Specific                    SEQUENCE {
          dci-Formats                    ENUMERATED {formats0-0-And-1-0, formats0-1-And-1-1},
          ...
        }
      }
    
    According to X.691 :
    
      If the sequence type has an extension marker in the "ComponentTypeLists"
      or in the "SequenceType" productions, then a single bit shall first be added to
      the field-list in a bit-field of length one.
    
    So for dci-Format0-0-AndFormat1-0, dci-Format2-1 and dci-Format2-2,
    even they are empty without other fields, there shall be still one extension bit
    to be added.
    
    Use compute_extensions_start() to determine position of extension in
    asn1c_lang_C_type_SEQUENCE_def() to fix this problem.
    f12568d6
32-sequence-of-OK.asn1.-P 12.1 KB