private static Location pcToLocation ( ClassContext classContext , Method method , int pc ) throws CFGBuilderException { CFG cfg = classContext . getCFG ( method ) ; for ( Iterator < Location > i = cfg . locationIterator ( ) ; i . hasNext ( ) ; ) { Location location = i . next ( ) ; if ( location . getHandle ( ) . getPosition ( ) == pc ) { return location ; } } return null ; }
Get a Location matching the given PC value . Because of JSR subroutines there may be multiple Locations referring to the given instruction . This method simply returns one of them arbitrarily .