diff --git a/src/link/script.y b/src/link/script.y index 84aa5e30..6cd4ecca 100644 --- a/src/link/script.y +++ b/src/link/script.y @@ -306,7 +306,9 @@ yy::parser::symbol_type yylex() { } str.push_back(c); } - context.file.sbumpc(); // Consume the closing quote. + if (c == '"') { + context.file.sbumpc(); + } return yy::parser::make_string(std::move(str)); } else if (c == '$') { diff --git a/test/link/script-unterminated-string.link b/test/link/script-unterminated-string.link index ab5d7ee1..2c3f28f6 100644 --- a/test/link/script-unterminated-string.link +++ b/test/link/script-unterminated-string.link @@ -1,2 +1,5 @@ rom0 "ROM0 +romx 2 + "ROM2 1K + "ROM2 1 diff --git a/test/link/script-unterminated-string.out b/test/link/script-unterminated-string.out index b84820ff..a7f1ead9 100644 --- a/test/link/script-unterminated-string.out +++ b/test/link/script-unterminated-string.out @@ -1,2 +1,4 @@ error: script-unterminated-string.link(2): Unterminated string -Linking failed with 1 error +error: script-unterminated-string.link(4): Unterminated string +error: script-unterminated-string.link(5): Unterminated string +Linking failed with 3 errors