@@ -106,8 +106,7 @@ private predicate operandEscapesDomain(Operand operand) {
106106 not isArgumentForParameter ( _, operand , _) and
107107 not isOnlyEscapesViaReturnArgument ( operand ) and
108108 not operand .getUse ( ) instanceof ReturnValueInstruction and
109- not operand .getUse ( ) instanceof ReturnIndirectionInstruction and
110- not operand instanceof PhiInputOperand
109+ not operand .getUse ( ) instanceof ReturnIndirectionInstruction
111110}
112111
113112/**
@@ -191,6 +190,11 @@ private predicate operandIsPropagated(Operand operand, IntValue bitOffset, Instr
191190 // A copy propagates the source value.
192191 operand = instr .( CopyInstruction ) .getSourceValueOperand ( ) and bitOffset = 0
193192 )
193+ or
194+ operand = instr .( PhiInstruction ) .getAnInputOperand ( ) and
195+ // Using `unknown` ensures termination since we cannot keep incrementing a bit offset
196+ // through the back edge of a loop (or through recursion).
197+ bitOffset = Ints:: unknown ( )
194198}
195199
196200private predicate operandEscapesNonReturn ( Operand operand ) {
@@ -212,9 +216,6 @@ private predicate operandEscapesNonReturn(Operand operand) {
212216 or
213217 isOnlyEscapesViaReturnArgument ( operand ) and resultEscapesNonReturn ( operand .getUse ( ) )
214218 or
215- operand instanceof PhiInputOperand and
216- resultEscapesNonReturn ( operand .getUse ( ) )
217- or
218219 operandEscapesDomain ( operand )
219220}
220221
@@ -236,9 +237,6 @@ private predicate operandMayReachReturn(Operand operand) {
236237 operand .getUse ( ) instanceof ReturnValueInstruction
237238 or
238239 isOnlyEscapesViaReturnArgument ( operand ) and resultMayReachReturn ( operand .getUse ( ) )
239- or
240- operand instanceof PhiInputOperand and
241- resultMayReachReturn ( operand .getUse ( ) )
242240}
243241
244242private predicate operandReturned ( Operand operand , IntValue bitOffset ) {
0 commit comments