Skip to content

Commit 48e6bdb

Browse files
committed
Ruby: Remove EmptinessCompletion
1 parent db6f843 commit 48e6bdb

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

ruby/ql/lib/codeql/ruby/controlflow/internal/Completion.qll

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ private import SuccessorTypes
1414
private newtype TCompletion =
1515
TSimpleCompletion() or
1616
TBooleanCompletion(boolean b) { b in [false, true] } or
17-
TEmptinessCompletion(boolean isEmpty) { isEmpty in [false, true] } or
1817
TMatchingCompletion(boolean isMatch) { isMatch in [false, true] } or
1918
TReturnCompletion() or
2019
TBreakCompletion() or
@@ -239,8 +238,8 @@ class SimpleCompletion extends NonNestedNormalCompletion, TSimpleCompletion {
239238

240239
/**
241240
* A completion that represents evaluation of an expression, whose value determines
242-
* the successor. Either a Boolean completion (`BooleanCompletion`), an emptiness
243-
* completion (`EmptinessCompletion`), or a matching completion (`MatchingCompletion`).
241+
* the successor. Either a Boolean completion (`BooleanCompletion`), or a matching
242+
* completion (`MatchingCompletion`).
244243
*/
245244
abstract class ConditionalCompletion extends NonNestedNormalCompletion {
246245
boolean value;
@@ -277,18 +276,6 @@ class FalseCompletion extends BooleanCompletion {
277276
FalseCompletion() { this.getValue() = false }
278277
}
279278

280-
/**
281-
* A completion that represents evaluation of an emptiness test, for example
282-
* a test in a `for in` statement.
283-
*/
284-
class EmptinessCompletion extends ConditionalCompletion, TEmptinessCompletion {
285-
EmptinessCompletion() { this = TEmptinessCompletion(value) }
286-
287-
override EmptinessSuccessor getAMatchingSuccessorType() { result.getValue() = value }
288-
289-
override string toString() { if value = true then result = "empty" else result = "non-empty" }
290-
}
291-
292279
/**
293280
* A completion that represents evaluation of a matching test, for example
294281
* a test in a `rescue` statement.

0 commit comments

Comments
 (0)