mirror of
https://github.com/github/codeql.git
synced 2026-02-02 00:02:57 +01:00
Merge pull request #13257 from smowton/smowton/hotfix/useless-assignment-to-field-exclude-method-receivers
Hotfix: Go: exclude method receivers from dead-store-of-field query
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user