Skip to content
Merged
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
4 changes: 2 additions & 2 deletions cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ class CastingNode extends Node {
CastingNode() {
this instanceof ParameterNode or
this instanceof CastNode or
this instanceof OutNode or
this.(PostUpdateNode).getPreUpdateNode() instanceof ArgumentNode
this instanceof OutNodeExt
}
}

Expand Down Expand Up @@ -564,6 +563,18 @@ class ReturnNodeExt extends Node {
}
}

/**
* A node to which data can flow from a call. Either an ordinary out node
* or a post-update node associated with a call argument.
*/
class OutNodeExt extends Node {
OutNodeExt() {
this instanceof OutNode
or
this.(PostUpdateNode).getPreUpdateNode() instanceof ArgumentNode
}
}

/**
* An extended return kind. A return kind describes how data can be returned
* from a callable. This can either be through a returned value or an updated
Expand All @@ -574,7 +585,7 @@ abstract class ReturnKindExt extends TReturnKindExt {
abstract string toString();

/** Gets a node corresponding to data flow out of `call`. */
abstract Node getAnOutNode(DataFlowCall call);
abstract OutNodeExt getAnOutNode(DataFlowCall call);
}

class ValueReturnKind extends ReturnKindExt, TValueReturn {
Expand All @@ -586,7 +597,9 @@ class ValueReturnKind extends ReturnKindExt, TValueReturn {

override string toString() { result = kind.toString() }

override Node getAnOutNode(DataFlowCall call) { result = getAnOutNode(call, this.getKind()) }
override OutNodeExt getAnOutNode(DataFlowCall call) {
result = getAnOutNode(call, this.getKind())
}
}

class ParamUpdateReturnKind extends ReturnKindExt, TParamUpdate {
Expand All @@ -598,9 +611,9 @@ class ParamUpdateReturnKind extends ReturnKindExt, TParamUpdate {

override string toString() { result = "param update " + pos }

override PostUpdateNode getAnOutNode(DataFlowCall call) {
override OutNodeExt getAnOutNode(DataFlowCall call) {
exists(ArgumentNode arg |
result.getPreUpdateNode() = arg and
result.(PostUpdateNode).getPreUpdateNode() = arg and
arg.argumentOf(call, this.getPosition())
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ class CastingNode extends Node {
CastingNode() {
this instanceof ParameterNode or
this instanceof CastNode or
this instanceof OutNode or
this.(PostUpdateNode).getPreUpdateNode() instanceof ArgumentNode
this instanceof OutNodeExt
}
}

Expand Down Expand Up @@ -564,6 +563,18 @@ class ReturnNodeExt extends Node {
}
}

/**
* A node to which data can flow from a call. Either an ordinary out node
* or a post-update node associated with a call argument.
*/
class OutNodeExt extends Node {
OutNodeExt() {
this instanceof OutNode
or
this.(PostUpdateNode).getPreUpdateNode() instanceof ArgumentNode
}
}

/**
* An extended return kind. A return kind describes how data can be returned
* from a callable. This can either be through a returned value or an updated
Expand All @@ -574,7 +585,7 @@ abstract class ReturnKindExt extends TReturnKindExt {
abstract string toString();

/** Gets a node corresponding to data flow out of `call`. */
abstract Node getAnOutNode(DataFlowCall call);
abstract OutNodeExt getAnOutNode(DataFlowCall call);
}

class ValueReturnKind extends ReturnKindExt, TValueReturn {
Expand All @@ -586,7 +597,9 @@ class ValueReturnKind extends ReturnKindExt, TValueReturn {

override string toString() { result = kind.toString() }

override Node getAnOutNode(DataFlowCall call) { result = getAnOutNode(call, this.getKind()) }
override OutNodeExt getAnOutNode(DataFlowCall call) {
result = getAnOutNode(call, this.getKind())
}
}

class ParamUpdateReturnKind extends ReturnKindExt, TParamUpdate {
Expand All @@ -598,9 +611,9 @@ class ParamUpdateReturnKind extends ReturnKindExt, TParamUpdate {

override string toString() { result = "param update " + pos }

override PostUpdateNode getAnOutNode(DataFlowCall call) {
override OutNodeExt getAnOutNode(DataFlowCall call) {
exists(ArgumentNode arg |
result.getPreUpdateNode() = arg and
result.(PostUpdateNode).getPreUpdateNode() = arg and
arg.argumentOf(call, this.getPosition())
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ class CastingNode extends Node {
CastingNode() {
this instanceof ParameterNode or
this instanceof CastNode or
this instanceof OutNode or
this.(PostUpdateNode).getPreUpdateNode() instanceof ArgumentNode
this instanceof OutNodeExt
}
}

Expand Down Expand Up @@ -564,6 +563,18 @@ class ReturnNodeExt extends Node {
}
}

/**
* A node to which data can flow from a call. Either an ordinary out node
* or a post-update node associated with a call argument.
*/
class OutNodeExt extends Node {
OutNodeExt() {
this instanceof OutNode
or
this.(PostUpdateNode).getPreUpdateNode() instanceof ArgumentNode
}
}

/**
* An extended return kind. A return kind describes how data can be returned
* from a callable. This can either be through a returned value or an updated
Expand All @@ -574,7 +585,7 @@ abstract class ReturnKindExt extends TReturnKindExt {
abstract string toString();

/** Gets a node corresponding to data flow out of `call`. */
abstract Node getAnOutNode(DataFlowCall call);
abstract OutNodeExt getAnOutNode(DataFlowCall call);
}

class ValueReturnKind extends ReturnKindExt, TValueReturn {
Expand All @@ -586,7 +597,9 @@ class ValueReturnKind extends ReturnKindExt, TValueReturn {

override string toString() { result = kind.toString() }

override Node getAnOutNode(DataFlowCall call) { result = getAnOutNode(call, this.getKind()) }
override OutNodeExt getAnOutNode(DataFlowCall call) {
result = getAnOutNode(call, this.getKind())
}
}

class ParamUpdateReturnKind extends ReturnKindExt, TParamUpdate {
Expand All @@ -598,9 +611,9 @@ class ParamUpdateReturnKind extends ReturnKindExt, TParamUpdate {

override string toString() { result = "param update " + pos }

override PostUpdateNode getAnOutNode(DataFlowCall call) {
override OutNodeExt getAnOutNode(DataFlowCall call) {
exists(ArgumentNode arg |
result.getPreUpdateNode() = arg and
result.(PostUpdateNode).getPreUpdateNode() = arg and
arg.argumentOf(call, this.getPosition())
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ private module LocalFlowBigStep {
jumpStep(_, node, config) or
additionalJumpStep(_, node, config) or
node instanceof ParameterNode or
node instanceof OutNode or
node instanceof PostUpdateNode or
node instanceof OutNodeExt or
store(_, _, node) or
read(_, _, node) or
node instanceof CastNode
)
Expand Down
Loading