File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
go/ql/lib/semmle/go/dataflow/internal Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -680,6 +680,24 @@ module Public {
680680 }
681681 }
682682
683+ /** A representation of a parameter initialization, defined in source via an SSA node. */
684+ class UnusedParameterNode extends ParameterNode , InstructionNode {
685+ override IR:: InitParameterInstruction insn ;
686+ Parameter parm ;
687+
688+ UnusedParameterNode ( ) {
689+ insn = IR:: initParamInstruction ( parm ) and
690+ not exists ( SsaExplicitDefinition ssa | ssa .getInstruction ( ) = insn )
691+ }
692+
693+ /** Gets the parameter this node initializes. */
694+ override Parameter asParameter ( ) { result = parm }
695+
696+ override predicate isParameterOf ( DataFlowCallable c , int i ) {
697+ parm .isParameterOf ( c .asCallable ( ) .getFuncDef ( ) , i )
698+ }
699+ }
700+
683701 /** A representation of a parameter initialization, defined in source via an SSA node. */
684702 class SsaParameterNode extends ParameterNode , SsaNode {
685703 override SsaExplicitDefinition ssa ;
You can’t perform that action at this time.
0 commit comments