mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 09:57:08 +08:00
[flang][runtime] Fix use of empty optional in BOZ input (#120789)
Slava reported a valgrind result showing the use of uninitialized data due to an unconditional dereference of an optional in BOZ formatted input editing; fix.
This commit is contained in:
@@ -130,7 +130,7 @@ static RT_API_ATTRS bool EditBOZInput(
|
||||
shift = shift - 8; // misaligned octal
|
||||
}
|
||||
while (digits > 0) {
|
||||
char32_t ch{*io.NextInField(remaining, edit)};
|
||||
char32_t ch{io.NextInField(remaining, edit).value_or(' ')};
|
||||
int digit{0};
|
||||
if (ch == ' ' || ch == '\t') {
|
||||
if (edit.modes.editingFlags & blankZero) {
|
||||
|
||||
Reference in New Issue
Block a user