Skip to content

Commit 99c2119

Browse files
committed
Hotfix: Go: exclude method receivers from dead-store-of-field query
1 parent 8b28848 commit 99c2119

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

go/ql/src/RedundantCode/DeadStoreOfField.ql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ predicate escapes(DataFlow::Node nd) {
3838
// if `nd` is passed to a function, then it escapes
3939
nd = any(DataFlow::CallNode c).getASyntacticArgument()
4040
or
41+
// if `nd` is the receiver of a function, then it escapes
42+
nd = any(DataFlow::MethodCallNode c).getReceiver()
43+
or
4144
// if `nd` has its address taken, then it escapes
4245
exists(AddressExpr ae | nd.asExpr() = ae.getOperand())
4346
or

0 commit comments

Comments
 (0)