Skip to content

Protect against empty tokens #2847

Description

@fm-117

In some cases (reported in SQL scanner but to be confirmed in Cobol scanner), the scanner may be stuck in an infinte loop creating empty tokens and not advancing its index.

While this should not happen, it is safer to protect against empty tokens.

Example code reproducing the problem:

       IDENTIFICATION DIVISION.
       PROGRAM-ID. UnsupportedBySqlScanner.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 WS-DATE-FIN        PIC X(10).
       PROCEDURE DIVISION.
           EXEC SQL
               SELECT * FROM PROJECTS
      * KO: operator '<' is not supported by SQL scanner
               WHERE DATE_FIN < :WS-DATE-FIN
           END-EXEC
       END PROGRAM UnsupportedBySqlScanner.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions