/** * processes a method call looking for parameters that are arrays. If this array was seen earlier as a simple wrapping array, then it marks it as being * having been used as a parameter. * */ private void processMethodCall() { if ("invoke".equals(getNameConstantOperand()) && "java/lang/reflect/Method".equals(getClassConstantOperand())) { return; } String sig = getSigConstantOperand(); List<String> args = SignatureUtils.getParameterSignatures(sig); if (stack.getStackDepth() >= args.size()) { for (int i = 0; i < args.size(); i++) { String argSig = args.get(i); if (argSig.startsWith(Values.SIG_ARRAY_PREFIX)) { OpcodeStack.Item itm = stack.getStackItem(args.size() - i - 1); int arrayReg = itm.getRegisterNumber(); WrapperInfo wi = wrappers.get(Integer.valueOf(arrayReg)); if (wi != null) { wi.wasArg = true; } } } } }
/** * looks for methods that contain a NEWARRAY or ANEWARRAY opcodes * * @param method * the context object of the current method * @return if the class uses synchronization */ public boolean prescreen(Method method) { BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && (bytecodeSet.get(Constants.NEWARRAY) || bytecodeSet.get(Constants.ANEWARRAY)); }
case CASTORE: case SASTORE: { userValue = processArrayElementStore(); case ASTORE_2: case ASTORE_3: { processLocalStore(seen); case INVOKESPECIAL: case INVOKESTATIC: { processMethodCall();
case Const.CASTORE: case Const.SASTORE: { userValue = processArrayElementStore(); case Const.ASTORE_2: case Const.ASTORE_3: { processLocalStore(seen); case Const.INVOKESPECIAL: case Const.INVOKESTATIC: { processMethodCall();
/** * processes a method call looking for parameters that are arrays. If this array was seen earlier as a simple wrapping array, then it marks it as being * having been used as a parameter. * */ private void processMethodCall() { if ("invoke".equals(getNameConstantOperand()) && "java/lang/reflect/Method".equals(getClassConstantOperand())) { return; } String sig = getSigConstantOperand(); List<String> args = SignatureUtils.getParameterSignatures(sig); if (stack.getStackDepth() >= args.size()) { for (int i = 0; i < args.size(); i++) { String argSig = args.get(i); if (argSig.startsWith(Values.SIG_ARRAY_PREFIX)) { OpcodeStack.Item itm = stack.getStackItem(args.size() - i - 1); int arrayReg = itm.getRegisterNumber(); WrapperInfo wi = wrappers.get(Integer.valueOf(arrayReg)); if (wi != null) { wi.wasArg = true; } } } } }
/** * looks for methods that contain a NEWARRAY or ANEWARRAY opcodes * * @param method * the context object of the current method * @return if the class uses synchronization */ public boolean prescreen(Method method) { BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && (bytecodeSet.get(Const.NEWARRAY) || bytecodeSet.get(Const.ANEWARRAY)); }