Skip to content

Subscript out of bounds #376

Open
Open
@yutaro-sakamoto

Description

@yutaro-sakamoto

The following tests fail.
These tests check the behaviours of subscripts out of bounds.

AT_SETUP([Subscript out of bounds without debug])
AT_CHECK([${SKIP_TEST}])
AT_DATA([prog.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 G.
02 X PIC X OCCURS 10.
01 I PIC 9 VALUE 0.
01 Z PIC X.
PROCEDURE DIVISION.
MOVE Z TO X(I).
STOP RUN.
])
AT_CHECK([${COMPILE_DEFAULT} prog.cob])
AT_CHECK([java prog], [0])
AT_CLEANUP
AT_SETUP([Subscript out of bounds check option])
AT_CHECK([${SKIP_TEST}])
AT_DATA([prog.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 G.
02 X PIC X OCCURS 10.
01 I PIC 9 VALUE 0.
01 Z PIC X.
PROCEDURE DIVISION.
MOVE Z TO X(I).
STOP RUN.
])
AT_CHECK([${COMPILE_JP_COMPAT_DEFAULT} prog.cob])
AT_CHECK([java prog], [1], ,
[libcobj: Subscript of 'X' out of bounds: 0
])

Metadata

Metadata

Labels

bugSomething isn't workingexisting_testbugs found by existing tests in tests/

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions