mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
C#: Get rid of the isOwnInstanceAccess based on ReturnStmt.
This commit is contained in:
@@ -9,9 +9,9 @@ import CaptureSummaryModelsSpecific
|
||||
* Gets the summary model of `api`, if it follows the `fluent` programming pattern (returns `this`).
|
||||
*/
|
||||
string captureQualifierFlow(TargetAPI api) {
|
||||
exists(ReturnStmt rtn |
|
||||
rtn.getEnclosingCallable() = api and
|
||||
isOwnInstanceAccess(rtn)
|
||||
exists(ReturnNodeExt ret |
|
||||
api = returnNodeEnclosingCallable(ret) and
|
||||
isOwnInstanceAccessNode(ret)
|
||||
) and
|
||||
result = asValueModel(api, qualifierString(), "ReturnValue")
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ import semmle.code.csharp.dataflow.internal.DataFlowImplCommon
|
||||
import semmle.code.csharp.dataflow.internal.DataFlowPrivate
|
||||
import ModelGeneratorUtils
|
||||
|
||||
predicate isOwnInstanceAccess(ReturnStmt rtn) { rtn.getExpr() instanceof ThisAccess }
|
||||
pragma[inline]
|
||||
Callable returnNodeEnclosingCallable(ReturnNodeExt ret) { result = getNodeEnclosingCallable(ret) }
|
||||
|
||||
predicate isOwnInstanceAccessNode(ReturnNode node) { node.asExpr() instanceof ThisAccess }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user