Fix two instances of possible infinite loops in the linker (#1292)

This commit is contained in:
Marcus Huderle
2024-02-08 04:46:04 -06:00
committed by GitHub
parent 8d48cc79a2
commit a37285eae9

View File

@@ -281,6 +281,7 @@ try_again: // Can't use a `do {} while(0)` loop, otherwise compilers (wrongly) t
uint32_t number = c - '0';
for (c = context.file.sgetc(); isDecDigit(c); c = context.file.sgetc()) {
number = number * 10 + (c - '0');
context.file.sbumpc();
}
return yy::parser::make_number(number);
} else if (isIdentChar(c)) { // Note that we match these *after* digit characters!
@@ -319,6 +320,7 @@ try_again: // Can't use a `do {} while(0)` loop, otherwise compilers (wrongly) t
if (c == EOF) {
break;
}
context.file.sbumpc();
}
goto try_again;
}