Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bc28e17

Browse filesBrowse files
committed
Refactor to get rid of duplication
1 parent 9f4fd7f commit bc28e17
Copy full SHA for bc28e17

1 file changed

+4-8Lines changed: 4 additions & 8 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • go/ql/lib/semmle/go/frameworks/stdlib
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎go/ql/lib/semmle/go/frameworks/stdlib/IoFs.qll‎

Copy file name to clipboardExpand all lines: go/ql/lib/semmle/go/frameworks/stdlib/IoFs.qll
+4-8Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,13 @@ module IoFs {
2020
private class WalkDirStep extends TaintTracking::AdditionalTaintStep {
2121
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
2222
//signature: func WalkDir(fsys FS, root string, fn WalkDirFunc) error
23-
exists(DataFlow::CallNode call, DataFlow::FunctionNode f |
24-
f.(DataFlow::FuncLitNode).getASuccessor*() = call.getArgument(2)
23+
exists(DataFlow::CallNode call, DataFlow::FunctionNode f, DataFlow::Node n |
24+
n = f.(DataFlow::FuncLitNode)
2525
or
26-
exists(DataFlow::ExprNode functionName |
27-
f.(DataFlow::GlobalFunctionNode).getFunction() =
28-
functionName.asExpr().(FunctionName).getTarget()
29-
|
30-
functionName.getASuccessor*() = call.getArgument(2)
31-
)
26+
n.asExpr().(FunctionName).getTarget() = f.(DataFlow::GlobalFunctionNode).getFunction()
3227
|
3328
call.getTarget().hasQualifiedName(packagePath(), "WalkDir") and
29+
n.getASuccessor*() = call.getArgument(2) and
3430
pred = call.getArgument(0) and
3531
succ = f.getParameter([0, 1])
3632
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.