Hotfix: Go: exclude method receivers from dead-store-of-field query

This commit is contained in:
Chris Smowton
2023-05-23 14:31:25 +01:00
parent 8b28848c82
commit 99c211955b

View File

@@ -38,6 +38,9 @@ predicate escapes(DataFlow::Node nd) {
// if `nd` is passed to a function, then it escapes
nd = any(DataFlow::CallNode c).getASyntacticArgument()
or
// if `nd` is the receiver of a function, then it escapes
nd = any(DataFlow::MethodCallNode c).getReceiver()
or
// if `nd` has its address taken, then it escapes
exists(AddressExpr ae | nd.asExpr() = ae.getOperand())
or