From a37285eae96c9c74a7b587af63be86387a02fc4f Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 8 Feb 2024 04:46:04 -0600 Subject: [PATCH] Fix two instances of possible infinite loops in the linker (#1292) --- src/link/script.y | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/link/script.y b/src/link/script.y index 853b909d..f3c92cf9 100644 --- a/src/link/script.y +++ b/src/link/script.y @@ -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; }