@@ -918,11 +918,12 @@ IRBlock getBasicBlock(Node node) {
918918 */
919919pragma [ nomagic]
920920int getAdditionalFlowIntoCallNodeTerm ( ArgumentNode arg , ParameterNode p ) {
921- exists ( ParameterNode switchee , ConditionOperand op , DataFlowCall call |
921+ exists ( ParameterNode switchee , SwitchInstruction switch , ConditionOperand op , DataFlowCall call |
922922 viableParamArg ( call , p , arg ) and
923923 viableParamArg ( call , switchee , _) and
924+ switch .getExpressionOperand ( ) = op and
924925 valueNumber ( switchee .asInstruction ( ) ) .getAUse ( ) = op and
925- result = countNumberOfBranchesUsingParameter ( op , p )
926+ result = countNumberOfBranchesUsingParameter ( switch , p )
926927 )
927928}
928929
@@ -954,9 +955,8 @@ private EdgeKind caseOrDefaultEdge() {
954955/**
955956 * Gets the number of switch branches that that read from (or write to) the parameter `p`.
956957 */
957- int countNumberOfBranchesUsingParameter ( ConditionOperand op , ParameterNode p ) {
958- exists ( SwitchInstruction switch , Ssa:: SourceVariable sv |
959- switch .getExpressionOperand ( ) = op and
958+ int countNumberOfBranchesUsingParameter ( SwitchInstruction switch , ParameterNode p ) {
959+ exists ( Ssa:: SourceVariable sv |
960960 parameterNodeHasSourceVariable ( p , sv ) and
961961 // Count the number of cases that use the parameter. We do this by finding the phi node
962962 // that merges the uses/defs of the parameter. There might be multiple such phi nodes, so
0 commit comments