mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
fix the signature of regexpCapture and regexpFind
This commit is contained in:
@@ -35,8 +35,8 @@ predicate isBuiltinMember(string sig) {
|
||||
"string int.toString()", "string string.charAt(int)", "int string.indexOf(string)",
|
||||
"int string.indexOf(string, int, int)", "predicate string.isLowercase()",
|
||||
"predicate string.isUppercase()", "int string.length()", "predicate string.matches(string)",
|
||||
"string string.prefix(int)", "string regexpCapture(string, int)",
|
||||
"string regexpFind(string, int, int)", "predicate string.regexpMatch(string)",
|
||||
"string string.prefix(int)", "string string.regexpCapture(string, int)",
|
||||
"string string.regexpFind(string, int, int)", "predicate string.regexpMatch(string)",
|
||||
"string string.regexpReplaceAll(string, string)", "string string.replaceAll(string, string)",
|
||||
"string string.splitAt(string)", "string string.splitAt(string, int)",
|
||||
"string string.substring(int, int)", "string string.suffix(int)", "date string.toDate()",
|
||||
@@ -58,6 +58,18 @@ predicate isBuiltinMember(string qual, string ret, string name, string args) {
|
||||
)
|
||||
}
|
||||
|
||||
module BuildinsConsistency {
|
||||
predicate noBuildinParse(string sig) {
|
||||
isBuiltinMember(sig) and
|
||||
not exists(sig.regexpCapture("(\\w+) (\\w+)\\.(\\w+)\\(([\\w, ]*)\\)", _))
|
||||
}
|
||||
|
||||
predicate noBuildinClasslessParse(string sig) {
|
||||
isBuiltinClassless(sig) and
|
||||
not exists(sig.regexpCapture("(\\w+) (\\w+)\\(([\\w, ]*)\\)", _))
|
||||
}
|
||||
}
|
||||
|
||||
bindingset[args]
|
||||
string getArgType(string args, int i) { result = args.splitAt(",", i).trim() }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user