Landing: fe37b9c1c4ec

Project / Subsystem

gcc / cobol

Date

2026-07-09

Author

James K. Lowden

Commit

fe37b9c1c4ecb5dbb3762755ad1bd6eccf524afd

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
cobol
patch_id
commit_hash
fe37b9c1c4ecb5dbb3762755ad1bd6eccf524afd
source_type
github
headline
cobol: Replace NUL input with space, with diagnostic.
tldr
Fixes COBOL parsing by replacing embedded NUL characters with spaces and issuing a diagnostic message.
author
James K. Lowden
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • cobol
  • lexer
  • error handling
  • character encoding
discussion_id_link
bugzilla_pr
date
2026-07-09T00:00:00.000Z

This commit addresses an issue in the COBOL compiler where NUL characters embedded within alphanumeric literals caused parsing errors, as the lexer treated NUL as an end-of-file marker. The code now detects NUL characters in the lexio file reader, replaces them with spaces, increments an error counter, and emits a diagnostic message. This ensures that COBOL source files with such characters can be processed correctly.