[lld] [ELF] Reject error-prone meta characters in input section description (PR #84130)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 09:23:50 PST 2024
================
@@ -717,9 +717,19 @@ SmallVector<SectionPattern, 0> ScriptParser::readInputSectionsList() {
StringMatcher SectionMatcher;
// Break if the next token is ), EXCLUDE_FILE, or SORT*.
- while (!errorCount() && peek() != ")" && peek() != "EXCLUDE_FILE" &&
- peekSortKind() == SortSectionPolicy::Default)
+ while (!errorCount() && peekSortKind() == SortSectionPolicy::Default) {
+ StringRef s = peek();
+ if (s == ")" || s == "EXCLUDE_FILE")
+ break;
+ // Detect common mistakes that certain non-wildcard meta characters used
----------------
MaskRay wrote:
Updated
https://github.com/llvm/llvm-project/pull/84130
More information about the llvm-commits
mailing list