File tree Expand file tree Collapse file tree
ruby/ql/lib/codeql/ruby/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,38 +21,15 @@ module Twirp {
2121 this = API:: getTopLevelMember ( "Twirp" ) .getMember ( "Service" ) .getAnInstantiation ( )
2222 }
2323
24- /**
25- * Gets a local source node for the Service instantiation argument (the service handler).
26- */
27- private DataFlow:: LocalSourceNode getHandlerSource ( ) {
28- result = this .getArgument ( 0 ) .getALocalSource ( )
29- }
30-
31- /**
32- * Gets the API::Node for the service handler's class.
33- */
34- private API:: Node getAHandlerClassApiNode ( ) {
35- result .getAnInstantiation ( ) = this .getHandlerSource ( )
36- }
37-
38- /**
39- * Gets the AST module for the service handler's class.
40- */
41- private Ast:: Module getAHandlerClassAstNode ( ) {
42- result =
43- this .getAHandlerClassApiNode ( )
44- .asSource ( )
45- .asExpr ( )
46- .( CfgNodes:: ExprNodes:: ConstantReadAccessCfgNode )
47- .getExpr ( )
48- .getModule ( )
24+ private DataFlow:: ClassNode getAHandlerClass ( ) {
25+ result .getAnImmediateReference ( ) .getAMethodCall ( "new" ) .flowsTo ( this .getArgument ( 0 ) )
4926 }
5027
5128 /**
5229 * Gets a handler's method.
5330 */
5431 Ast:: Method getAHandlerMethod ( ) {
55- result = this .getAHandlerClassAstNode ( ) .getAnInstanceMethod ( )
32+ result = this .getAHandlerClass ( ) .getAnAncestor ( ) . getAnOwnInstanceMethod ( ) . asCallableAstNode ( )
5633 }
5734 }
5835
You can’t perform that action at this time.
0 commit comments