Describe the bug
When the SYNCHRONIZED clause is used for an item contained in a group which is an OCCURS, some slack bytes might be added by the compiler at the end of each occurrence. Our parser misses them. The length of the group is consequently wrong.
To Reproduce
IDENTIFICATION DIVISION.
PROGRAM-ID. TCOCCSLK.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WORK-RECORD.
05 WORK-CODE PIC X.
05 COMP-TABLE OCCURS 10 TIMES.
10 COMP-TYPE PIC X.
* [10 SLACK-BYTES PIC XX. INSERTED BY COMPILER]
10 COMP-PAY PIC S9(4)V99 COMP SYNC.
10 COMP-HOURS PIC S9(3) COMP SYNC.
10 COMP-NAME PIC X(5).
* [10 SLACK-BYTES PIC XX. INSERTED BY COMPILER]
05 VAR-AFTER PIC X.
PROCEDURE DIVISION.
GOBACK
.
END PROGRAM TCOCCSLK.
Each occurrence of COMP-TABLE has a length = 14 according to our parser:
COMP-TYPE = 1
[SLACK-BYTES = 2]
COMP-PAY = 4
COMP-HOURS = 2
COMP-NAME = 5
Expected behavior
Length should be 16.
Describe the bug
When the SYNCHRONIZED clause is used for an item contained in a group which is an OCCURS, some slack bytes might be added by the compiler at the end of each occurrence. Our parser misses them. The length of the group is consequently wrong.
To Reproduce
Each occurrence of COMP-TABLE has a length = 14 according to our parser:
COMP-TYPE = 1
[SLACK-BYTES = 2]
COMP-PAY = 4
COMP-HOURS = 2
COMP-NAME = 5
Expected behavior
Length should be 16.