mirror of
https://github.com/github/codeql.git
synced 2026-04-22 07:15:15 +02:00
Ruby: Fix semantic merge conflict
This commit is contained in:
@@ -43,6 +43,10 @@ private module Input implements InputSig<RubyDataFlow> {
|
||||
arg.asExpr().getASuccessor(any(SuccessorTypes::ConditionalSuccessor c)).getASuccessor*() = n and
|
||||
n.getASplit() instanceof Split::ConditionalCompletionSplit
|
||||
)
|
||||
or
|
||||
// Synthetic block parameter nodes are passed directly as lambda-self reference
|
||||
// arguments to all `yield` calls
|
||||
arg instanceof ArgumentNodes::BlockParameterArgumentNode
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -916,7 +916,7 @@ private module ParameterNodes {
|
||||
* The value of a block parameter at function entry, viewed as a node in a data
|
||||
* flow graph.
|
||||
*/
|
||||
class BlockParameterNode extends ParameterNodeImpl, ArgumentNode, TBlockParameterNode {
|
||||
class BlockParameterNode extends ParameterNodeImpl, TBlockParameterNode {
|
||||
private MethodBase method;
|
||||
|
||||
BlockParameterNode() { this = TBlockParameterNode(method) }
|
||||
@@ -935,16 +935,6 @@ private module ParameterNodes {
|
||||
this.getMethod() = result.getExpr().(YieldCall).getEnclosingMethod()
|
||||
}
|
||||
|
||||
// needed for variable capture flow
|
||||
override predicate sourceArgumentOf(CfgNodes::ExprNodes::CallCfgNode call, ArgumentPosition pos) {
|
||||
call = this.getAYieldCall() and
|
||||
pos.isLambdaSelf()
|
||||
}
|
||||
|
||||
override predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
|
||||
this.sourceArgumentOf(call.asCall(), pos)
|
||||
}
|
||||
|
||||
override CfgScope getCfgScope() { result = method }
|
||||
|
||||
override Location getLocationImpl() {
|
||||
@@ -1199,7 +1189,7 @@ abstract class ArgumentNode extends Node {
|
||||
final DataFlowCall getCall() { this.argumentOf(result, _) }
|
||||
}
|
||||
|
||||
private module ArgumentNodes {
|
||||
module ArgumentNodes {
|
||||
/** A data-flow node that represents an explicit call argument. */
|
||||
class ExplicitArgumentNode extends ArgumentNode {
|
||||
Argument arg;
|
||||
@@ -1215,6 +1205,20 @@ private module ArgumentNodes {
|
||||
}
|
||||
}
|
||||
|
||||
class BlockParameterArgumentNode extends BlockParameterNode, ArgumentNode {
|
||||
BlockParameterArgumentNode() { exists(this.getAYieldCall()) }
|
||||
|
||||
// needed for variable capture flow
|
||||
override predicate sourceArgumentOf(CfgNodes::ExprNodes::CallCfgNode call, ArgumentPosition pos) {
|
||||
call = this.getAYieldCall() and
|
||||
pos.isLambdaSelf()
|
||||
}
|
||||
|
||||
override predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
|
||||
this.sourceArgumentOf(call.asCall(), pos)
|
||||
}
|
||||
}
|
||||
|
||||
private class SummaryArgumentNode extends FlowSummaryNode, ArgumentNode {
|
||||
private DataFlowCall call_;
|
||||
private ArgumentPosition pos_;
|
||||
|
||||
Reference in New Issue
Block a user