Actions: Avoid blowup in quotation parser

The parser has an inherent N^2 blowup and will need a rewrite eventually. For now I'm just trying to make it not blow up as often.
This commit is contained in:
Asger F
2025-02-05 13:16:47 +01:00
parent e6b5040909
commit 1904b026b2

View File

@@ -81,7 +81,9 @@ class BashShellScript extends ShellScript {
"qstr:" + k + ":" + i + ":" + j + ":" + quotedStr.length() + ":" +
quotedStr.regexpReplaceAll("[^a-zA-Z0-9]", "")
)
)
) and
// Only do this for strings that might otherwise disrupt subsequent parsing
quotedStr.regexpMatch("[\"'].*[$\n\r'\"" + Bash::separator() + "].*[\"']")
}
private predicate rankedQuotedStringReplacements(int i, string old, string new) {