Skip to content

Commit cc995b1

Browse files
committed
PS: Generalize getARead.
1 parent 950a10b commit cc995b1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

powershell/ql/lib/semmle/code/powershell/dataflow/Ssa.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ module Ssa {
99
private import semmle.code.powershell.Cfg
1010
private import powershell
1111
private import internal.SsaImpl as SsaImpl
12-
private import CfgNodes::ExprNodes
12+
private import CfgNodes
13+
private import ExprNodes
1314

1415
/** A static single assignment (SSA) definition. */
1516
class Definition extends SsaImpl::Definition {
@@ -23,7 +24,7 @@ module Ssa {
2324
}
2425

2526
/** Gets a control-flow node that reads the value of this SSA definition. */
26-
final VarReadAccessCfgNode getARead() { result = SsaImpl::getARead(this) }
27+
final AstCfgNode getARead() { result = SsaImpl::getARead(this) }
2728

2829
/**
2930
* Gets a first control-flow node that reads the value of this SSA definition.

powershell/ql/lib/semmle/code/powershell/dataflow/internal/SsaImpl.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ private module Cached {
209209
}
210210

211211
cached
212-
VarReadAccessCfgNode getARead(Definition def) {
212+
AstCfgNode getARead(Definition def) {
213213
exists(SsaInput::SourceVariable v, Cfg::BasicBlock bb, int i |
214214
Impl::ssaDefReachesRead(v, def, bb, i) and
215-
variableReadActual(bb, i, v) and
215+
SsaInput::variableRead(bb, i, v, true) and
216216
result = bb.getNode(i)
217217
)
218218
}

0 commit comments

Comments
 (0)