Skip to content

Commit a86a940

Browse files
committed
add getRepr() and toString() on RelevantState
1 parent 3f1cb04 commit a86a940

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

java/ql/lib/semmle/code/java/security/regexp/NfaUtils.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,11 @@ module PrefixConstruction<isCandidateSig/1 isCandidate> {
968968
exists(State s | isCandidate(s) | getRoot(s.getRepr()) = getRoot(this.getRepr()))
969969
}
970970

971-
string toString() { result = "RelevantState" }
971+
/** Gets a string representation for this state in a regular expression. */
972+
string toString() { result = State.super.toString() }
973+
974+
/** Gets the term represented by this state. */
975+
RegExpTerm getRepr() { result = State.super.getRepr() }
972976
}
973977
}
974978

javascript/ql/lib/semmle/javascript/security/regexp/NfaUtils.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,11 @@ module PrefixConstruction<isCandidateSig/1 isCandidate> {
968968
exists(State s | isCandidate(s) | getRoot(s.getRepr()) = getRoot(this.getRepr()))
969969
}
970970

971-
string toString() { result = "RelevantState" }
971+
/** Gets a string representation for this state in a regular expression. */
972+
string toString() { result = State.super.toString() }
973+
974+
/** Gets the term represented by this state. */
975+
RegExpTerm getRepr() { result = State.super.getRepr() }
972976
}
973977
}
974978

python/ql/lib/semmle/python/security/regexp/NfaUtils.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,11 @@ module PrefixConstruction<isCandidateSig/1 isCandidate> {
968968
exists(State s | isCandidate(s) | getRoot(s.getRepr()) = getRoot(this.getRepr()))
969969
}
970970

971-
string toString() { result = "RelevantState" }
971+
/** Gets a string representation for this state in a regular expression. */
972+
string toString() { result = State.super.toString() }
973+
974+
/** Gets the term represented by this state. */
975+
RegExpTerm getRepr() { result = State.super.getRepr() }
972976
}
973977
}
974978

ruby/ql/lib/codeql/ruby/security/regexp/NfaUtils.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,11 @@ module PrefixConstruction<isCandidateSig/1 isCandidate> {
968968
exists(State s | isCandidate(s) | getRoot(s.getRepr()) = getRoot(this.getRepr()))
969969
}
970970

971-
string toString() { result = "RelevantState" }
971+
/** Gets a string representation for this state in a regular expression. */
972+
string toString() { result = State.super.toString() }
973+
974+
/** Gets the term represented by this state. */
975+
RegExpTerm getRepr() { result = State.super.getRepr() }
972976
}
973977
}
974978

0 commit comments

Comments
 (0)