File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
swift/ql/test/TestUtilities Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,7 @@ string defaultTaintFlowTag() { result = "hasTaintFlow" }
8181
8282private string getSourceArgString ( DataFlow:: Node src ) {
8383 defaultSource ( src ) and
84- (
85- src .asExpr ( ) .( CallExpr ) .getAnArgument ( ) .getExpr ( ) .( StringLiteralExpr ) .getValue ( ) = result
86- or
87- not src .asExpr ( ) .( CallExpr ) .getAnArgument ( ) .getExpr ( ) instanceof StringLiteralExpr and
88- result = src .getLocation ( ) .getStartLine ( ) .toString ( )
89- )
84+ src .asExpr ( ) .( CallExpr ) .getAnArgument ( ) .getExpr ( ) .( StringLiteralExpr ) .getValue ( ) = result
9085}
9186
9287module FlowTest<
@@ -105,7 +100,9 @@ module FlowTest<
105100 exists ( DataFlow:: Node src , DataFlow:: Node sink | ValueFlow:: flow ( src , sink ) |
106101 sink .getLocation ( ) = location and
107102 element = sink .toString ( ) and
108- if exists ( getSourceArgString ( src ) ) then value = getSourceArgString ( src ) else value = ""
103+ if exists ( getSourceArgString ( src ) )
104+ then value = getSourceArgString ( src )
105+ else value = src .getLocation ( ) .getStartLine ( ) .toString ( )
109106 )
110107 or
111108 tag = taintFlowTag ( ) and
@@ -114,7 +111,9 @@ module FlowTest<
114111 |
115112 sink .getLocation ( ) = location and
116113 element = sink .toString ( ) and
117- if exists ( getSourceArgString ( src ) ) then value = getSourceArgString ( src ) else value = ""
114+ if exists ( getSourceArgString ( src ) )
115+ then value = getSourceArgString ( src )
116+ else value = src .getLocation ( ) .getStartLine ( ) .toString ( )
118117 )
119118 }
120119 }
You can’t perform that action at this time.
0 commit comments