File tree Expand file tree Collapse file tree 1 file changed +6
-19
lines changed
swift/ql/lib/codeql/swift/dataflow/internal Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -399,26 +399,13 @@ private module ReturnNodes {
399399 override ReturnKind getKind ( ) { result instanceof NormalReturnKind }
400400 }
401401
402- class SelfReturnNode extends ReturnNode , TInoutReturnNode , NodeImpl {
403- SelfParamDecl param ;
404- ControlFlowNode exit ;
405- SelfReturnNode ( ) {
406- this = TInoutReturnNode ( param ) and
407- exit instanceof ExitNode and
408- exit .getScope ( ) = param .getDeclaringFunction ( ) and
409- param .getDeclaringFunction ( ) instanceof ConstructorDecl
410- }
411- override ControlFlowNode getCfgNode ( ) { result = exit }
412-
413- override DataFlowCallable getEnclosingCallable ( ) {
414- result = TDataFlowFunc ( param .getDeclaringFunction ( ) )
415- }
416-
417- ParamDecl getParameter ( ) { result = param }
418-
419- override Location getLocationImpl ( ) { result = exit .getLocation ( ) }
402+ /**
403+ * A data-flow node that represents the `self` value in a constructor being
404+ * implicitly returned as the newly-constructed object
405+ * */
406+ class SelfReturnNode extends InoutReturnNodeImpl {
407+ SelfReturnNode ( ) { exit .getScope ( ) instanceof ConstructorDecl }
420408
421- override string toStringImpl ( ) { result = param .toString ( ) + "[constructor return]" }
422409 override ReturnKind getKind ( ) { result instanceof NormalReturnKind }
423410 }
424411
You can’t perform that action at this time.
0 commit comments