Skip to content

Equivalence: COMMAREA OCCURS fields are compared at the first occurrence only; det LINK of an OCCURS DTO passes the first occurrence's extent #4765

Closed

Description

@squid-protocol

Found while unblocking CBSA's INQACCCU-COMMAREA (data after a POINTER, register C9; PR #4764).

What. A generated COMMAREA DTO lists the fields of an OCCURS group once ("Fields inside an OCCURS group appear once; the offsets and the width count every occurrence"), and the equivalence harness's record layout (equivalence_common.layout_fields) does the same. So for a COMMAREA with an OCCURS:

  1. The proof compares the first occurrence only. cbsa-inqacccu FETCHes up to 20 accounts into ACCOUNT-DETAILS OCCURS 1 TO 20 DEPENDING ON NUMBER-OF-ACCOUNTS; the RETURN's COMMAREA is compared on NUMBER-OF-ACCOUNTS and account 1's fields. Accounts 2..N are never compared on either side (the det DTO's fill_ reads occurrence 1; decode_record reads occurrence 1).
  2. A det LINK of such a DTO passes Dto.size bytes, the leaves' extent -- for an OCCURS DTO without a POINTER that is the first occurrence's end, not the record's (det/cics.py LINK: Cobol.commarea(f, dsize)), so a det callee's bytes past it never reach the caller. det + harness: a COMMAREA with data after a POINTER, each side by its own layout (Part of #4270) #4764 fixes this for DTOs with a POINTER (the declared record length, widened); a DTO with OCCURS and no POINTER keeps the old extent so no proven port moved. In the burned corpora only INQACCCU's DTO has the OCCURS note (CBSA CustctrlDfhcommarea and GenApp Lg*Dfhcommarea differ from their declared length for other reasons -- trailing FILLER -- worth checking too).

Want. The harness compares every occurrence up to the ODO object's value (or the OCCURS maximum), by name and subscript, on both sides -- for the det port from its bytes, which already carry every occurrence -- and the det LINK span is the record's declared length for any DTO whose header says so. Then re-prove cbsa-inqacccu with a scenario whose accounts 2..3 differ.

Part of #4270.

Activity

  1. added
    enhancement
    testing
    legacy-modernization
    on Oct 9, 2026
  2. added 3 commits that reference this issue on Oct 9, 2026
    e60b93f
    7073ba4
    e82a948
  3. added
    scope:core
    era:2
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementera:2legacy-modernizationpriority: mediumscope:coretesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions