cobol: Fix undefined loc for CALL args
Cobol compiler now prevents undefined location information for CALL arguments.
This commit fixes an issue where Cobol CALL arguments could lead to diagnostics reporting undefined line or column numbers. By ensuring proper location tracking for arguments, including numeric literals, the compiler now generates accurate and meaningful error messages, preventing confusing output like arbitrary line numbers.
In Details
The GCC Cobol front-end must correctly establish source code locations for all elements involved in a CALL statement, especially arguments. This commit addresses a bug where certain argument processing paths could result in undefined location data being associated with diagnostics. By ensuring that location information is properly set or cleared, this change prevents spurious line/column numbers from appearing in error messages.
- CALL statement
- A Cobol statement used to invoke a subroutine or external program.
- Diagnostic
- An error, warning, or informational message generated by the compiler to report issues or provide feedback to the programmer about the source code.
- Source Code Location
- Refers to the specific line number and column number within a source file where a particular piece of code is located, used for error reporting and debugging.