File tree Expand file tree Collapse file tree
go/ql/lib/semmle/go/controlflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -432,9 +432,6 @@ module GoCfg {
432432 or
433433 n instanceof Go:: IncDecStmt and tag = "incdec-rhs"
434434 or
435- // Return node
436- n instanceof Go:: ReturnStmt and tag = "return"
437- or
438435 // Result write nodes in return statements
439436 exists ( int i , Go:: ReturnStmt ret |
440437 n = ret and
@@ -950,7 +947,7 @@ module GoCfg {
950947 n2 .isAdditional ( ret , tag2 )
951948 )
952949 or
953- // Last return epilogue → In(ret) (the return itself)
950+ // Last return epilogue → return node
954951 n1 .isAdditional ( ret , getLastReturnEpilogueTag ( ret ) ) and
955952 n2 .isIn ( ret )
956953 )
Original file line number Diff line number Diff line change @@ -893,7 +893,7 @@ module IR {
893893 class ReturnInstruction extends Instruction {
894894 ReturnStmt ret ;
895895
896- ReturnInstruction ( ) { this .isAdditional ( ret , "return" ) }
896+ ReturnInstruction ( ) { this .isIn ( ret ) }
897897
898898 /** Gets the corresponding `ReturnStmt`. */
899899 ReturnStmt getReturnStmt ( ) { result = ret }
@@ -938,9 +938,7 @@ module IR {
938938 exists ( retStmt .getAnExpr ( ) )
939939 }
940940
941- private ReturnInstruction getReturnInstruction ( ) {
942- result .( ReturnInstruction ) .isAdditional ( retStmt , "return" )
943- }
941+ private ReturnInstruction getReturnInstruction ( ) { result .getReturnStmt ( ) = retStmt }
944942
945943 override Instruction getRhs ( ) { result = this .getReturnInstruction ( ) .getResult ( idx ) }
946944
You can’t perform that action at this time.
0 commit comments