Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 1a5d582

Browse files
committed
Remove Regexp
1 parent e742525 commit 1a5d582

File tree

1 file changed

+0
-64
lines changed

1 file changed

+0
-64
lines changed

ql/src/semmle/go/frameworks/Stdlib.qll

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -482,70 +482,6 @@ module URL {
482482
}
483483
}
484484

485-
/** Provides models of commonly used APIs in the `regexp` package. */
486-
module Regexp {
487-
private class Pattern extends RegexpPattern::Range, DataFlow::ArgumentNode {
488-
string fnName;
489-
490-
Pattern() {
491-
exists(Function fn | fnName.matches("Match%") or fnName.matches("%Compile%") |
492-
fn.hasQualifiedName("regexp", fnName) and
493-
this = fn.getACall().getArgument(0)
494-
)
495-
}
496-
497-
override DataFlow::Node getAParse() { result = this.getCall() }
498-
499-
override string getPattern() { result = this.asExpr().getStringValue() }
500-
501-
override DataFlow::Node getAUse() {
502-
fnName.matches("MustCompile%") and
503-
result = this.getCall().getASuccessor*()
504-
or
505-
fnName.matches("Compile%") and
506-
result = this.getCall().getResult(0).getASuccessor*()
507-
or
508-
result = this
509-
}
510-
}
511-
512-
private class MatchFunction extends RegexpMatchFunction::Range, Function {
513-
MatchFunction() {
514-
exists(string fn | fn.matches("Match%") | this.hasQualifiedName("regexp", fn))
515-
}
516-
517-
override FunctionInput getRegexpArg() { result.isParameter(0) }
518-
519-
override FunctionInput getValue() { result.isParameter(1) }
520-
521-
override FunctionOutput getResult() { result.isResult(0) }
522-
}
523-
524-
private class MatchMethod extends RegexpMatchFunction::Range, Method {
525-
MatchMethod() {
526-
exists(string fn | fn.matches("Match%") | this.hasQualifiedName("regexp", "Regexp", fn))
527-
}
528-
529-
override FunctionInput getRegexpArg() { result.isReceiver() }
530-
531-
override FunctionInput getValue() { result.isParameter(0) }
532-
533-
override FunctionOutput getResult() { result.isResult() }
534-
}
535-
536-
private class ReplaceFunction extends RegexpReplaceFunction::Range, Method {
537-
ReplaceFunction() {
538-
exists(string fn | fn.matches("ReplaceAll%") | this.hasQualifiedName("regexp", "Regexp", fn))
539-
}
540-
541-
override FunctionInput getRegexpArg() { result.isReceiver() }
542-
543-
override FunctionInput getSource() { result.isParameter(0) }
544-
545-
override FunctionOutput getResult() { result.isResult() }
546-
}
547-
}
548-
549485
/** Provides models of some functions in the `crypto/cipher` package. */
550486
module CryptoCipher {
551487
private class AeadOpenFunction extends TaintTracking::FunctionModel, Method {

0 commit comments

Comments
 (0)