Skip to content

Commit 0d1ac77

Browse files
committed
SSA/Ruby: Address review comments.
1 parent 5a986f5 commit 0d1ac77

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
479479

480480
Expr getARead(Definition def) { result = Cached::getARead(def) }
481481

482+
predicate ssaDefHasSource(WriteDefinition def) {
483+
any(ParameterExt p).isInitializedBy(def) or def.(Ssa::WriteDefinition).assigns(_)
484+
}
485+
482486
class Guard extends Cfg::CfgNodes::AstCfgNode {
483487
/**
484488
* Holds if the control flow branching from `bb1` is dependent on this guard,

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
16901690
/** Gets the underlying definition. */
16911691
WriteDefinition getDefinition() { result = def }
16921692

1693-
override string toString() { result = def.toString() }
1693+
override string toString() { result = "[source] " + def.toString() }
16941694

16951695
override Location getLocation() { result = def.getLocation() }
16961696
}

0 commit comments

Comments
 (0)