Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions java/ql/lib/semmle/code/java/ControlFlowGraph.qll
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,6 @@ module ControlFlow {
/** Gets the expression this `Node` corresponds to, if any. */
Expr asExpr() { this = TExprNode(result) }

/** Gets the call this `Node` corresponds to, if any. */
Call asCall() {
result = this.asExpr() or
result = this.asStmt()
}

/** Gets a textual representation of this element. */
string toString() { none() }

Expand Down
9 changes: 9 additions & 0 deletions java/ql/lib/semmle/code/java/Expr.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,9 @@ class ClassInstanceExpr extends Expr, ConstructorCall, @classinstancexpr {
/** Gets the immediately enclosing statement of this class instance creation expression. */
override Stmt getEnclosingStmt() { result = Expr.super.getEnclosingStmt() }

/** Gets the `ControlFlowNode` corresponding to this call. */
override ControlFlowNode getControlFlowNode() { result = Expr.super.getControlFlowNode() }

/** Gets a printable representation of this expression. */
override string toString() {
result = "new " + this.getConstructor().getName() + "(...)"
Expand Down Expand Up @@ -2113,6 +2116,9 @@ class MethodCall extends Expr, Call, @methodaccess {
/** Gets the immediately enclosing statement that contains this method access. */
override Stmt getEnclosingStmt() { result = Expr.super.getEnclosingStmt() }

/** Gets the `ControlFlowNode` corresponding to this call. */
override ControlFlowNode getControlFlowNode() { result = Expr.super.getControlFlowNode() }

/** Gets a printable representation of this expression. */
override string toString() {
if exists(this.getMethod())
Expand Down Expand Up @@ -2305,6 +2311,9 @@ class Call extends ExprParent, @caller {
/** Gets the enclosing statement of this call. */
/*abstract*/ Stmt getEnclosingStmt() { none() }

/** Gets the `ControlFlowNode` corresponding to this call. */
/*abstract*/ ControlFlowNode getControlFlowNode() { none() }

/** Gets the number of arguments provided in this call. */
int getNumArgument() { count(this.getAnArgument()) = result }

Expand Down
8 changes: 7 additions & 1 deletion java/ql/lib/semmle/code/java/Statement.qll
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Stmt extends StmtParent, ExprParent, @stmt {
}

/** A statement parent is any element that can have a statement as its child. */
class StmtParent extends @stmtparent, Top { }
class StmtParent extends @stmtparent, ExprParent { }

/**
* An error statement.
Expand Down Expand Up @@ -960,6 +960,9 @@ class ThisConstructorInvocationStmt extends Stmt, ConstructorCall, @constructori
/** Gets the immediately enclosing statement of this constructor invocation. */
override Stmt getEnclosingStmt() { result = this }

/** Gets the `ControlFlowNode` corresponding to this call. */
override ControlFlowNode getControlFlowNode() { result = Stmt.super.getControlFlowNode() }

override string pp() { result = "this(...)" }

override string toString() { result = "this(...)" }
Expand Down Expand Up @@ -1001,6 +1004,9 @@ class SuperConstructorInvocationStmt extends Stmt, ConstructorCall, @superconstr
/** Gets the immediately enclosing statement of this constructor invocation. */
override Stmt getEnclosingStmt() { result = this }

/** Gets the `ControlFlowNode` corresponding to this call. */
override ControlFlowNode getControlFlowNode() { result = Stmt.super.getControlFlowNode() }

override string pp() { result = "super(...)" }

override string toString() { result = "super(...)" }
Expand Down
2 changes: 1 addition & 1 deletion java/ql/lib/semmle/code/java/controlflow/Paths.qll
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class ActionConfiguration extends string {
private BasicBlock actionBlock(ActionConfiguration conf) {
exists(ControlFlowNode node | result = node.getBasicBlock() |
conf.isAction(node) or
callAlwaysPerformsAction(node.asCall(), conf)
callAlwaysPerformsAction(any(Call call | call.getControlFlowNode() = node), conf)
)
}

Expand Down
2 changes: 1 addition & 1 deletion java/ql/lib/semmle/code/java/dataflow/InstanceAccess.qll
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class InstanceAccessExt extends TInstanceAccessExt {
/** Gets the control flow node associated with this instance access. */
ControlFlowNode getCfgNode() {
exists(ExprParent e | e = this.getAssociatedExprOrStmt() |
result.asCall() = e
result = e.(Call).getControlFlowNode()
or
e.(InstanceAccess).getControlFlowNode() = result
or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private module BaseSsaImpl {
inner != outer and
inner.getDeclaringType() = innerclass and
result = parentDef(desugaredGetEnclosingType*(innerclass)) and
result.getEnclosingStmt().getEnclosingCallable() = outer and
result.getEnclosingCallable() = outer and
capturedvar = TLocalVar(outer, v) and
closurevar = TLocalVar(inner, v)
)
Expand Down
11 changes: 7 additions & 4 deletions java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private ControlFlowNode captureNode(TrackedVar capturedvar, TrackedVar closureva
inner != outer and
inner.getDeclaringType() = innerclass and
result = parentDef(desugaredGetEnclosingType*(innerclass)) and
result.getEnclosingStmt().getEnclosingCallable() = outer and
result.getEnclosingCallable() = outer and
capturedvar = TLocalVar(outer, v) and
closurevar = TLocalVar(inner, v)
)
Expand Down Expand Up @@ -153,7 +153,7 @@ private predicate hasEntryDef(TrackedVar v, BasicBlock b) {
overlay[global]
pragma[nomagic]
private predicate uncertainVariableUpdateImpl(TrackedVar v, ControlFlowNode n, BasicBlock b, int i) {
exists(Call c | c = n.asCall() | updatesNamedField(c, v, _)) and
exists(Call c | c.getControlFlowNode() = n | updatesNamedField(c, v, _)) and
b.getNode(i) = n and
hasDominanceInformation(b)
or
Expand Down Expand Up @@ -525,8 +525,11 @@ private module Cached {
overlay[global]
cached
predicate defUpdatesNamedField(SsaImplicitWrite calldef, TrackedField f, Callable setter) {
f = calldef.getSourceVariable() and
updatesNamedField0(calldef.getControlFlowNode().asCall(), f, setter)
exists(Call call |
f = calldef.getSourceVariable() and
call.getControlFlowNode() = calldef.getControlFlowNode() and
updatesNamedField0(call, f, setter)
)
}

/** Holds if `init` is a closure variable that captures the value of `capturedvar`. */
Expand Down
4 changes: 2 additions & 2 deletions java/ql/src/experimental/quantum/Examples/ArtifactReuse.qll
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private DataFlow::Node getGeneratingWrapperSet(Crypto::NonceArtifactNode a) {
}

private predicate ancestorOfArtifact(
Crypto::ArtifactNode a, Callable enclosingCallable, ControlFlow::Node midOrTarget
Crypto::ArtifactNode a, Callable enclosingCallable, ControlFlowNode midOrTarget
) {
a.asElement().(Expr).getEnclosingCallable() = enclosingCallable and
(
Expand Down Expand Up @@ -87,7 +87,7 @@ predicate isArtifactReuse(Crypto::ArtifactNode a, Crypto::ArtifactNode b) {
ancestorOfArtifact(b, commonParent, _)
)
implies
exists(Callable commonParent, ControlFlow::Node aMid, ControlFlow::Node bMid |
exists(Callable commonParent, ControlFlowNode aMid, ControlFlowNode bMid |
ancestorOfArtifact(a, commonParent, aMid) and
ancestorOfArtifact(b, commonParent, bMid) and
a instanceof Crypto::NonceArtifactNode and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,157 +1,20 @@
| Test.kt:2:43:79:2 | { ... } | Test.kt:3:13:3:13 | var ...; |
| Test.kt:3:13:3:13 | var ...; | Test.kt:3:17:3:18 | px |
| Test.kt:3:13:3:13 | x | Test.kt:4:13:4:13 | var ...; |
| Test.kt:3:17:3:18 | px | Test.kt:3:13:3:13 | x |
| Test.kt:4:13:4:13 | var ...; | Test.kt:4:17:4:18 | pw |
| Test.kt:4:13:4:13 | w | Test.kt:5:13:5:13 | var ...; |
| Test.kt:4:17:4:18 | pw | Test.kt:4:13:4:13 | w |
| Test.kt:5:13:5:13 | var ...; | Test.kt:5:17:5:18 | pz |
| Test.kt:5:13:5:13 | z | Test.kt:7:7:7:7 | var ...; |
| Test.kt:5:17:5:18 | pz | Test.kt:5:13:5:13 | z |
| Test.kt:7:7:7:7 | j | Test.kt:8:7:8:7 | var ...; |
| Test.kt:7:7:7:7 | var ...; | Test.kt:7:7:7:7 | j |
| Test.kt:8:7:8:7 | var ...; | Test.kt:8:17:8:18 | 50 |
| Test.kt:8:7:8:7 | y | Test.kt:11:3:16:3 | <Expr>; |
| Test.kt:8:17:8:18 | 50 | Test.kt:8:7:8:7 | y |
| Test.kt:11:3:16:3 | ... -> ... | Test.kt:11:3:16:3 | true |
| Test.kt:11:3:16:3 | ... -> ... | Test.kt:11:7:11:7 | x |
| Test.kt:11:3:16:3 | <Expr>; | Test.kt:11:3:16:3 | when ... |
| Test.kt:11:3:16:3 | true | Test.kt:14:10:16:3 | { ... } |
| Test.kt:11:3:16:3 | when ... | Test.kt:11:3:16:3 | ... -> ... |
| Test.kt:11:7:11:7 | x | Test.kt:11:11:11:11 | 0 |
| Test.kt:11:7:11:11 | ... > ... | Test.kt:11:3:16:3 | ... -> ... |
| Test.kt:11:7:11:11 | ... > ... | Test.kt:11:14:14:3 | { ... } |
| Test.kt:11:7:11:11 | ... > ... | Test.kt:18:3:18:3 | <Expr>; |
| Test.kt:11:11:11:11 | 0 | Test.kt:11:7:11:11 | ... > ... |
| Test.kt:11:14:14:3 | { ... } | Test.kt:12:4:12:4 | <Expr>; |
| Test.kt:12:4:12:4 | <Expr>; | Test.kt:12:8:12:9 | 20 |
| Test.kt:12:4:12:9 | ...=... | Test.kt:13:4:13:4 | <Expr>; |
| Test.kt:12:8:12:9 | 20 | Test.kt:12:4:12:9 | ...=... |
| Test.kt:13:4:13:4 | <Expr>; | Test.kt:13:8:13:9 | 10 |
| Test.kt:13:8:13:9 | 10 | Test.kt:13:4:13:9 | ...=... |
| Test.kt:14:10:16:3 | { ... } | Test.kt:15:4:15:4 | <Expr>; |
| Test.kt:15:4:15:4 | <Expr>; | Test.kt:15:8:15:9 | 30 |
| Test.kt:15:8:15:9 | 30 | Test.kt:15:4:15:9 | ...=... |
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:18:8:18:8 | x |
| Test.kt:18:3:18:20 | ...=... | Test.kt:21:3:24:11 | <Expr>; |
| Test.kt:18:7:18:20 | (...)... | Test.kt:18:3:18:20 | ...=... |
| Test.kt:18:8:18:8 | x | Test.kt:18:12:18:12 | y |
| Test.kt:18:8:18:12 | ... + ... | Test.kt:18:7:18:20 | (...)... |
| Test.kt:18:12:18:12 | y | Test.kt:18:8:18:12 | ... + ... |
| Test.kt:21:3:24:11 | ... -> ... | Test.kt:21:3:24:11 | true |
| Test.kt:21:3:24:11 | ... -> ... | Test.kt:21:7:21:7 | x |
| Test.kt:21:3:24:11 | <Expr>; | Test.kt:21:3:24:11 | when ... |
| Test.kt:21:3:24:11 | true | Test.kt:24:11:24:11 | z |
| Test.kt:21:3:24:11 | when ... | Test.kt:21:3:24:11 | ... -> ... |
| Test.kt:21:7:21:7 | x | Test.kt:21:11:21:11 | 0 |
| Test.kt:21:7:21:11 | ... < ... | Test.kt:2:2:79:2 | Normal Exit |
| Test.kt:21:7:21:11 | ... < ... | Test.kt:21:3:24:11 | ... -> ... |
| Test.kt:21:7:21:11 | ... < ... | Test.kt:22:4:22:4 | <Expr>; |
| Test.kt:21:11:21:11 | 0 | Test.kt:21:7:21:11 | ... < ... |
| Test.kt:22:4:22:4 | <Expr>; | Test.kt:22:8:22:9 | 40 |
| Test.kt:22:4:22:9 | ...=... | Test.kt:27:3:27:3 | <Expr>; |
| Test.kt:22:8:22:9 | 40 | Test.kt:22:4:22:9 | ...=... |
| Test.kt:24:11:24:11 | z | Test.kt:24:4:24:11 | return ... |
| Test.kt:27:3:27:3 | <Expr>; | Test.kt:27:7:27:8 | 10 |
| Test.kt:27:3:27:8 | ...=... | Test.kt:30:3:33:3 | <Expr>; |
| Test.kt:27:7:27:8 | 10 | Test.kt:27:3:27:8 | ...=... |
| Test.kt:30:3:33:3 | ... -> ... | Test.kt:30:7:30:7 | x |
| Test.kt:30:3:33:3 | <Expr>; | Test.kt:30:3:33:3 | when ... |
| Test.kt:30:3:33:3 | when ... | Test.kt:30:3:33:3 | ... -> ... |
| Test.kt:30:7:30:7 | x | Test.kt:30:12:30:12 | 0 |
| Test.kt:30:7:30:12 | ... (value equals) ... | Test.kt:30:15:33:3 | { ... } |
| Test.kt:30:7:30:12 | ... (value equals) ... | Test.kt:35:3:35:3 | <Expr>; |
| Test.kt:30:12:30:12 | 0 | Test.kt:30:7:30:12 | ... (value equals) ... |
| Test.kt:30:15:33:3 | { ... } | Test.kt:31:4:31:4 | <Expr>; |
| Test.kt:31:4:31:4 | <Expr>; | Test.kt:31:8:31:9 | 60 |
| Test.kt:31:4:31:9 | ...=... | Test.kt:32:4:32:4 | <Expr>; |
| Test.kt:31:8:31:9 | 60 | Test.kt:31:4:31:9 | ...=... |
| Test.kt:32:4:32:4 | <Expr>; | Test.kt:32:8:32:9 | 10 |
| Test.kt:32:8:32:9 | 10 | Test.kt:32:4:32:9 | ...=... |
| Test.kt:35:3:35:3 | <Expr>; | Test.kt:35:3:35:3 | z |
| Test.kt:35:3:35:3 | z | Test.kt:35:8:35:8 | x |
| Test.kt:35:3:35:8 | ...+=... | Test.kt:38:3:41:3 | while (...) |
| Test.kt:35:8:35:8 | x | Test.kt:35:3:35:8 | ...+=... |
| Test.kt:38:3:41:3 | while (...) | Test.kt:38:10:38:10 | x |
| Test.kt:38:10:38:10 | x | Test.kt:38:14:38:14 | 0 |
| Test.kt:38:10:38:14 | ... > ... | Test.kt:38:17:41:3 | { ... } |
| Test.kt:38:10:38:14 | ... > ... | Test.kt:43:3:43:3 | <Expr>; |
| Test.kt:38:14:38:14 | 0 | Test.kt:38:10:38:14 | ... > ... |
| Test.kt:38:17:41:3 | { ... } | Test.kt:39:4:39:4 | <Expr>; |
| Test.kt:39:4:39:4 | <Expr>; | Test.kt:39:8:39:9 | 10 |
| Test.kt:39:4:39:9 | ...=... | Test.kt:40:4:40:6 | <Expr>; |
| Test.kt:39:8:39:9 | 10 | Test.kt:39:4:39:9 | ...=... |
| Test.kt:40:4:40:4 | <Expr>; | Test.kt:40:4:40:6 | tmp0 |
| Test.kt:40:4:40:4 | x | Test.kt:40:4:40:6 | tmp0 |
| Test.kt:40:4:40:6 | ...=... | Test.kt:40:4:40:6 | <Expr>; |
| Test.kt:40:4:40:6 | <Expr>; | Test.kt:40:4:40:6 | <Stmt> |
| Test.kt:40:4:40:6 | <Expr>; | Test.kt:40:4:40:6 | tmp0 |
| Test.kt:40:4:40:6 | <Stmt> | Test.kt:40:4:40:6 | { ... } |
| Test.kt:40:4:40:6 | dec(...) | Test.kt:40:4:40:6 | ...=... |
| Test.kt:40:4:40:6 | tmp0 | Test.kt:40:4:40:4 | <Expr>; |
| Test.kt:40:4:40:6 | tmp0 | Test.kt:40:4:40:6 | <implicit coercion to unit> |
| Test.kt:40:4:40:6 | tmp0 | Test.kt:40:4:40:6 | dec(...) |
| Test.kt:40:4:40:6 | var ...; | Test.kt:40:4:40:4 | x |
| Test.kt:40:4:40:6 | { ... } | Test.kt:40:4:40:6 | var ...; |
| Test.kt:43:3:43:3 | <Expr>; | Test.kt:43:3:43:3 | z |
| Test.kt:43:3:43:3 | z | Test.kt:43:8:43:8 | y |
| Test.kt:43:3:43:15 | ...+=... | Test.kt:73:3:73:3 | <Expr>; |
| Test.kt:43:8:43:8 | y | Test.kt:43:8:43:15 | (...)... |
| Test.kt:43:8:43:15 | (...)... | Test.kt:43:3:43:15 | ...+=... |
| Test.kt:73:3:73:3 | <Expr>; | Test.kt:73:3:73:3 | z |
| Test.kt:73:3:73:3 | z | Test.kt:73:8:73:8 | x |
| Test.kt:73:3:73:16 | ...+=... | Test.kt:77:3:77:3 | <Expr>; |
| Test.kt:73:8:73:8 | x | Test.kt:73:12:73:12 | y |
| Test.kt:73:8:73:12 | ... + ... | Test.kt:73:16:73:16 | w |
| Test.kt:73:8:73:16 | ... + ... | Test.kt:73:3:73:16 | ...+=... |
| Test.kt:73:12:73:12 | <implicit cast> | Test.kt:73:8:73:12 | ... + ... |
| Test.kt:73:12:73:12 | y | Test.kt:73:12:73:12 | <implicit cast> |
| Test.kt:73:16:73:16 | w | Test.kt:73:8:73:16 | ... + ... |
| Test.kt:77:3:77:3 | <Expr>; | Test.kt:77:7:77:8 | 40 |
| Test.kt:77:3:77:8 | ...=... | Test.kt:78:10:78:10 | w |
| Test.kt:77:7:77:8 | 40 | Test.kt:77:3:77:8 | ...=... |
| Test.kt:78:10:78:10 | w | Test.kt:78:3:78:10 | return ... |
| Test.kt:81:25:98:2 | { ... } | Test.kt:83:7:83:7 | var ...; |
| Test.kt:83:7:83:7 | b | Test.kt:84:7:84:7 | var ...; |
| Test.kt:83:7:83:7 | var ...; | Test.kt:83:7:83:7 | b |
| Test.kt:84:7:84:7 | c | Test.kt:85:3:85:3 | <Expr>; |
| Test.kt:84:7:84:7 | var ...; | Test.kt:84:7:84:7 | c |
| Test.kt:85:3:85:3 | <Expr>; | Test.kt:85:7:85:7 | 0 |
| Test.kt:85:3:85:7 | ...=... | Test.kt:86:3:96:3 | while (...) |
| Test.kt:85:7:85:7 | 0 | Test.kt:85:3:85:7 | ...=... |
| Test.kt:86:3:96:3 | while (...) | Test.kt:86:9:86:12 | true |
| Test.kt:86:9:86:12 | true | Test.kt:86:15:96:3 | { ... } |
| Test.kt:86:15:96:3 | { ... } | Test.kt:87:4:87:4 | <Expr>; |
| Test.kt:87:4:87:4 | <Expr>; | Test.kt:87:8:87:9 | 10 |
| Test.kt:87:4:87:9 | ...=... | Test.kt:88:4:91:4 | <Expr>; |
| Test.kt:87:8:87:9 | 10 | Test.kt:87:4:87:9 | ...=... |
| Test.kt:88:4:91:4 | ... -> ... | Test.kt:88:8:88:8 | a |
| Test.kt:88:4:91:4 | <Expr>; | Test.kt:88:4:91:4 | when ... |
| Test.kt:88:4:91:4 | when ... | Test.kt:88:4:91:4 | ... -> ... |
| Test.kt:88:8:88:8 | a | Test.kt:88:12:88:14 | 100 |
| Test.kt:88:8:88:14 | ... > ... | Test.kt:88:17:91:4 | { ... } |
| Test.kt:88:8:88:14 | ... > ... | Test.kt:92:4:93:9 | <Expr>; |
| Test.kt:88:12:88:14 | 100 | Test.kt:88:8:88:14 | ... > ... |
| Test.kt:88:17:91:4 | { ... } | Test.kt:89:5:89:5 | <Expr>; |
| Test.kt:89:5:89:5 | <Expr>; | Test.kt:89:9:89:10 | 10 |
| Test.kt:89:5:89:10 | ...=... | Test.kt:90:5:90:5 | <Expr>; |
| Test.kt:89:9:89:10 | 10 | Test.kt:89:5:89:10 | ...=... |
| Test.kt:90:5:90:5 | <Expr>; | Test.kt:90:9:90:9 | c |
| Test.kt:90:9:90:9 | c | Test.kt:90:5:90:9 | ...=... |
| Test.kt:92:4:93:9 | ... -> ... | Test.kt:92:8:92:8 | a |
| Test.kt:92:4:93:9 | <Expr>; | Test.kt:92:4:93:9 | when ... |
| Test.kt:92:4:93:9 | when ... | Test.kt:92:4:93:9 | ... -> ... |
| Test.kt:92:8:92:8 | a | Test.kt:92:13:92:14 | 10 |
| Test.kt:92:8:92:14 | ... (value equals) ... | Test.kt:81:2:98:2 | Normal Exit |
| Test.kt:92:8:92:14 | ... (value equals) ... | Test.kt:93:5:93:9 | break |
| Test.kt:92:8:92:14 | ... (value equals) ... | Test.kt:94:4:95:12 | <Expr>; |
| Test.kt:92:13:92:14 | 10 | Test.kt:92:8:92:14 | ... (value equals) ... |
| Test.kt:93:5:93:9 | break | Test.kt:97:10:97:10 | b |
| Test.kt:94:4:95:12 | ... -> ... | Test.kt:94:8:94:8 | a |
| Test.kt:94:4:95:12 | <Expr>; | Test.kt:94:4:95:12 | when ... |
| Test.kt:94:4:95:12 | when ... | Test.kt:94:4:95:12 | ... -> ... |
| Test.kt:94:8:94:8 | a | Test.kt:94:13:94:14 | 20 |
| Test.kt:94:8:94:14 | ... (value equals) ... | Test.kt:95:12:95:12 | c |
| Test.kt:94:13:94:14 | 20 | Test.kt:94:8:94:14 | ... (value equals) ... |
| Test.kt:95:12:95:12 | c | Test.kt:95:5:95:12 | return ... |
| Test.kt:97:10:97:10 | b | Test.kt:97:3:97:10 | return ... |
| Test.kt:2:2:79:2 | Normal Exit | Test.kt:2:2:79:2 | Exit |
| Test.kt:2:43:79:2 | { ... } | Test.kt:11:3:16:3 | ... -> ... |
| Test.kt:2:43:79:2 | { ... } | Test.kt:11:14:14:3 | { ... } |
| Test.kt:2:43:79:2 | { ... } | Test.kt:18:3:18:3 | <Expr>; |
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:2:2:79:2 | Normal Exit |
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:21:3:24:11 | ... -> ... |
| Test.kt:18:3:18:3 | <Expr>; | Test.kt:22:4:22:4 | <Expr>; |
| Test.kt:22:4:22:4 | <Expr>; | Test.kt:30:15:33:3 | { ... } |
| Test.kt:22:4:22:4 | <Expr>; | Test.kt:35:3:35:3 | <Expr>; |
| Test.kt:35:3:35:3 | <Expr>; | Test.kt:38:10:38:10 | x |
| Test.kt:38:10:38:10 | x | Test.kt:38:17:41:3 | { ... } |
| Test.kt:38:10:38:10 | x | Test.kt:43:3:43:3 | <Expr>; |
| Test.kt:81:2:98:2 | Normal Exit | Test.kt:81:2:98:2 | Exit |
| Test.kt:81:25:98:2 | { ... } | Test.kt:86:9:86:12 | true |
| Test.kt:86:9:86:12 | true | Test.kt:88:17:91:4 | { ... } |
| Test.kt:86:9:86:12 | true | Test.kt:92:4:93:9 | <Expr>; |
| Test.kt:92:4:93:9 | <Expr>; | Test.kt:81:2:98:2 | Normal Exit |
| Test.kt:92:4:93:9 | <Expr>; | Test.kt:93:5:93:9 | break |
| Test.kt:92:4:93:9 | <Expr>; | Test.kt:94:4:95:12 | <Expr>; |
| Test.kt:94:4:95:12 | <Expr>; | Test.kt:95:12:95:12 | c |
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import default
import semmle.code.java.controlflow.Dominance
import java

from Method func, ControlFlowNode dominator, ControlFlowNode node
from Method func, BasicBlock dominator, BasicBlock bb
where
iDominates(dominator, node) and
dominator.getEnclosingStmt().getEnclosingCallable() = func and
dominator.immediatelyDominates(bb) and
dominator.getEnclosingCallable() = func and
func.getDeclaringType().hasName("Test")
select dominator, node
select dominator, bb
Loading
Loading