Skip to content

Commit cc3f2ee

Browse files
author
Alvaro Muñoz
committed
add characteristic predicates to InputExpr and OutputExpr
1 parent 3c5358c commit cc3f2ee

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

ql/lib/codeql/actions/Ast.qll

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ class OutputsStmt extends Statement instanceof YamlMapping {
9696
}
9797
}
9898

99-
// TODO: Needs a characteristic predicate otherwise anything is an output expression
100-
class InputExpr extends Expression instanceof YamlString { }
99+
class InputExpr extends Expression instanceof YamlString {
100+
InputExpr() { exists(InputsStmt inputs | inputs.(YamlMapping).maps(this, _)) }
101+
}
101102

102-
// TODO: Needs a characteristic predicate otherwise anything is an output expression
103-
class OutputExpr extends Expression instanceof YamlString { }
103+
class OutputExpr extends Expression instanceof YamlString {
104+
OutputExpr() { exists(OutputsStmt outputs | outputs.(YamlMapping).maps(_, this)) }
105+
}
104106

105107
/**
106108
* A Job is a collection of steps that run in an execution environment.

ql/lib/codeql/actions/controlflow/internal/Cfg.qll

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ module Completion {
3535

3636
override string toString() { result = "BooleanCompletion(" + value + ")" }
3737

38-
override predicate isValidForSpecific(AstNode e) {
39-
none()
40-
// TODO: add support for conditional expressions?
41-
//e = any(ConditionalExpression c).getCondition()
42-
}
38+
override predicate isValidForSpecific(AstNode e) { none() }
4339

4440
override BooleanSuccessor getAMatchingSuccessorType() { result.getValue() = value }
4541

0 commit comments

Comments
 (0)