Skip to content

Commit ca09649

Browse files
committed
Dataflow: Forward hasLocationInfo.
1 parent 2001ce3 commit ca09649

File tree

8 files changed

+240
-0
lines changed

8 files changed

+240
-0
lines changed

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,12 @@ class CastingNode instanceof Node {
965965
CastingNode() { castingNode(this) }
966966

967967
string toString() { result = super.toString() }
968+
969+
predicate hasLocationInfo(
970+
string filepath, int startline, int startcolumn, int endline, int endcolumn
971+
) {
972+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
973+
}
968974
}
969975

970976
private predicate readStepWithTypes(
@@ -1117,6 +1123,12 @@ class ParamNode instanceof Node {
11171123

11181124
string toString() { result = super.toString() }
11191125

1126+
predicate hasLocationInfo(
1127+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1128+
) {
1129+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1130+
}
1131+
11201132
/**
11211133
* Holds if this node is the parameter of callable `c` at the specified
11221134
* position.
@@ -1130,6 +1142,12 @@ class ArgNode instanceof Node {
11301142

11311143
string toString() { result = super.toString() }
11321144

1145+
predicate hasLocationInfo(
1146+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1147+
) {
1148+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1149+
}
1150+
11331151
/** Holds if this argument occurs at the given position in the given call. */
11341152
final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
11351153
argumentNode(this, call, pos)
@@ -1145,6 +1163,12 @@ class ReturnNodeExt instanceof Node {
11451163

11461164
string toString() { result = super.toString() }
11471165

1166+
predicate hasLocationInfo(
1167+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1168+
) {
1169+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1170+
}
1171+
11481172
/** Gets the kind of this returned value. */
11491173
ReturnKindExt getKind() { returnNodeExt(this, result) }
11501174
}
@@ -1157,6 +1181,12 @@ class OutNodeExt instanceof Node {
11571181
OutNodeExt() { outNodeExt(this) }
11581182

11591183
string toString() { result = super.toString() }
1184+
1185+
predicate hasLocationInfo(
1186+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1187+
) {
1188+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1189+
}
11601190
}
11611191

11621192
/**

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,12 @@ class CastingNode instanceof Node {
965965
CastingNode() { castingNode(this) }
966966

967967
string toString() { result = super.toString() }
968+
969+
predicate hasLocationInfo(
970+
string filepath, int startline, int startcolumn, int endline, int endcolumn
971+
) {
972+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
973+
}
968974
}
969975

970976
private predicate readStepWithTypes(
@@ -1117,6 +1123,12 @@ class ParamNode instanceof Node {
11171123

11181124
string toString() { result = super.toString() }
11191125

1126+
predicate hasLocationInfo(
1127+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1128+
) {
1129+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1130+
}
1131+
11201132
/**
11211133
* Holds if this node is the parameter of callable `c` at the specified
11221134
* position.
@@ -1130,6 +1142,12 @@ class ArgNode instanceof Node {
11301142

11311143
string toString() { result = super.toString() }
11321144

1145+
predicate hasLocationInfo(
1146+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1147+
) {
1148+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1149+
}
1150+
11331151
/** Holds if this argument occurs at the given position in the given call. */
11341152
final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
11351153
argumentNode(this, call, pos)
@@ -1145,6 +1163,12 @@ class ReturnNodeExt instanceof Node {
11451163

11461164
string toString() { result = super.toString() }
11471165

1166+
predicate hasLocationInfo(
1167+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1168+
) {
1169+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1170+
}
1171+
11481172
/** Gets the kind of this returned value. */
11491173
ReturnKindExt getKind() { returnNodeExt(this, result) }
11501174
}
@@ -1157,6 +1181,12 @@ class OutNodeExt instanceof Node {
11571181
OutNodeExt() { outNodeExt(this) }
11581182

11591183
string toString() { result = super.toString() }
1184+
1185+
predicate hasLocationInfo(
1186+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1187+
) {
1188+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1189+
}
11601190
}
11611191

11621192
/**

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,12 @@ class CastingNode instanceof Node {
965965
CastingNode() { castingNode(this) }
966966

967967
string toString() { result = super.toString() }
968+
969+
predicate hasLocationInfo(
970+
string filepath, int startline, int startcolumn, int endline, int endcolumn
971+
) {
972+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
973+
}
968974
}
969975

970976
private predicate readStepWithTypes(
@@ -1117,6 +1123,12 @@ class ParamNode instanceof Node {
11171123

11181124
string toString() { result = super.toString() }
11191125

1126+
predicate hasLocationInfo(
1127+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1128+
) {
1129+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1130+
}
1131+
11201132
/**
11211133
* Holds if this node is the parameter of callable `c` at the specified
11221134
* position.
@@ -1130,6 +1142,12 @@ class ArgNode instanceof Node {
11301142

11311143
string toString() { result = super.toString() }
11321144

1145+
predicate hasLocationInfo(
1146+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1147+
) {
1148+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1149+
}
1150+
11331151
/** Holds if this argument occurs at the given position in the given call. */
11341152
final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
11351153
argumentNode(this, call, pos)
@@ -1145,6 +1163,12 @@ class ReturnNodeExt instanceof Node {
11451163

11461164
string toString() { result = super.toString() }
11471165

1166+
predicate hasLocationInfo(
1167+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1168+
) {
1169+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1170+
}
1171+
11481172
/** Gets the kind of this returned value. */
11491173
ReturnKindExt getKind() { returnNodeExt(this, result) }
11501174
}
@@ -1157,6 +1181,12 @@ class OutNodeExt instanceof Node {
11571181
OutNodeExt() { outNodeExt(this) }
11581182

11591183
string toString() { result = super.toString() }
1184+
1185+
predicate hasLocationInfo(
1186+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1187+
) {
1188+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1189+
}
11601190
}
11611191

11621192
/**

go/ql/lib/semmle/go/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,12 @@ class CastingNode instanceof Node {
965965
CastingNode() { castingNode(this) }
966966

967967
string toString() { result = super.toString() }
968+
969+
predicate hasLocationInfo(
970+
string filepath, int startline, int startcolumn, int endline, int endcolumn
971+
) {
972+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
973+
}
968974
}
969975

970976
private predicate readStepWithTypes(
@@ -1117,6 +1123,12 @@ class ParamNode instanceof Node {
11171123

11181124
string toString() { result = super.toString() }
11191125

1126+
predicate hasLocationInfo(
1127+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1128+
) {
1129+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1130+
}
1131+
11201132
/**
11211133
* Holds if this node is the parameter of callable `c` at the specified
11221134
* position.
@@ -1130,6 +1142,12 @@ class ArgNode instanceof Node {
11301142

11311143
string toString() { result = super.toString() }
11321144

1145+
predicate hasLocationInfo(
1146+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1147+
) {
1148+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1149+
}
1150+
11331151
/** Holds if this argument occurs at the given position in the given call. */
11341152
final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
11351153
argumentNode(this, call, pos)
@@ -1145,6 +1163,12 @@ class ReturnNodeExt instanceof Node {
11451163

11461164
string toString() { result = super.toString() }
11471165

1166+
predicate hasLocationInfo(
1167+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1168+
) {
1169+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1170+
}
1171+
11481172
/** Gets the kind of this returned value. */
11491173
ReturnKindExt getKind() { returnNodeExt(this, result) }
11501174
}
@@ -1157,6 +1181,12 @@ class OutNodeExt instanceof Node {
11571181
OutNodeExt() { outNodeExt(this) }
11581182

11591183
string toString() { result = super.toString() }
1184+
1185+
predicate hasLocationInfo(
1186+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1187+
) {
1188+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1189+
}
11601190
}
11611191

11621192
/**

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,12 @@ class CastingNode instanceof Node {
965965
CastingNode() { castingNode(this) }
966966

967967
string toString() { result = super.toString() }
968+
969+
predicate hasLocationInfo(
970+
string filepath, int startline, int startcolumn, int endline, int endcolumn
971+
) {
972+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
973+
}
968974
}
969975

970976
private predicate readStepWithTypes(
@@ -1117,6 +1123,12 @@ class ParamNode instanceof Node {
11171123

11181124
string toString() { result = super.toString() }
11191125

1126+
predicate hasLocationInfo(
1127+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1128+
) {
1129+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1130+
}
1131+
11201132
/**
11211133
* Holds if this node is the parameter of callable `c` at the specified
11221134
* position.
@@ -1130,6 +1142,12 @@ class ArgNode instanceof Node {
11301142

11311143
string toString() { result = super.toString() }
11321144

1145+
predicate hasLocationInfo(
1146+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1147+
) {
1148+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1149+
}
1150+
11331151
/** Holds if this argument occurs at the given position in the given call. */
11341152
final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
11351153
argumentNode(this, call, pos)
@@ -1145,6 +1163,12 @@ class ReturnNodeExt instanceof Node {
11451163

11461164
string toString() { result = super.toString() }
11471165

1166+
predicate hasLocationInfo(
1167+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1168+
) {
1169+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1170+
}
1171+
11481172
/** Gets the kind of this returned value. */
11491173
ReturnKindExt getKind() { returnNodeExt(this, result) }
11501174
}
@@ -1157,6 +1181,12 @@ class OutNodeExt instanceof Node {
11571181
OutNodeExt() { outNodeExt(this) }
11581182

11591183
string toString() { result = super.toString() }
1184+
1185+
predicate hasLocationInfo(
1186+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1187+
) {
1188+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1189+
}
11601190
}
11611191

11621192
/**

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplCommon.qll

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,12 @@ class CastingNode instanceof Node {
965965
CastingNode() { castingNode(this) }
966966

967967
string toString() { result = super.toString() }
968+
969+
predicate hasLocationInfo(
970+
string filepath, int startline, int startcolumn, int endline, int endcolumn
971+
) {
972+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
973+
}
968974
}
969975

970976
private predicate readStepWithTypes(
@@ -1117,6 +1123,12 @@ class ParamNode instanceof Node {
11171123

11181124
string toString() { result = super.toString() }
11191125

1126+
predicate hasLocationInfo(
1127+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1128+
) {
1129+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1130+
}
1131+
11201132
/**
11211133
* Holds if this node is the parameter of callable `c` at the specified
11221134
* position.
@@ -1130,6 +1142,12 @@ class ArgNode instanceof Node {
11301142

11311143
string toString() { result = super.toString() }
11321144

1145+
predicate hasLocationInfo(
1146+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1147+
) {
1148+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1149+
}
1150+
11331151
/** Holds if this argument occurs at the given position in the given call. */
11341152
final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
11351153
argumentNode(this, call, pos)
@@ -1145,6 +1163,12 @@ class ReturnNodeExt instanceof Node {
11451163

11461164
string toString() { result = super.toString() }
11471165

1166+
predicate hasLocationInfo(
1167+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1168+
) {
1169+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1170+
}
1171+
11481172
/** Gets the kind of this returned value. */
11491173
ReturnKindExt getKind() { returnNodeExt(this, result) }
11501174
}
@@ -1157,6 +1181,12 @@ class OutNodeExt instanceof Node {
11571181
OutNodeExt() { outNodeExt(this) }
11581182

11591183
string toString() { result = super.toString() }
1184+
1185+
predicate hasLocationInfo(
1186+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1187+
) {
1188+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1189+
}
11601190
}
11611191

11621192
/**

0 commit comments

Comments
 (0)