Java 类org.apache.bcel.generic.AALOAD 实例源码

项目:findbugs-all-the-bugs    文件:FindSqlInjection.java   
private boolean isSafeValue(Location location, ConstantPoolGen cpg) throws CFGBuilderException {
    Instruction prevIns = location.getHandle().getInstruction();
    if (prevIns instanceof LDC || prevIns instanceof GETSTATIC)
        return true;
    if (prevIns instanceof InvokeInstruction) {
        String methodName = ((InvokeInstruction) prevIns).getMethodName(cpg);
        if (methodName.startsWith("to") && methodName.endsWith("String") && methodName.length() > 8)
            return true;
    }
    if (prevIns instanceof AALOAD) {
        CFG cfg = classContext.getCFG(method);

        Location prev = getPreviousLocation(cfg, location, true);
        if (prev != null) {
            Location prev2 = getPreviousLocation(cfg, prev, true);
            if (prev2 != null && prev2.getHandle().getInstruction() instanceof GETSTATIC) {
                GETSTATIC getStatic = (GETSTATIC) prev2.getHandle().getInstruction();
                if (getStatic.getSignature(cpg).equals("[Ljava/lang/String;"))
                    return true;
            }
        }
    }
    return false;
}
项目:FindBug-for-Domino-Designer    文件:FindSqlInjection.java   
private boolean isSafeValue(Location location, ConstantPoolGen cpg) throws CFGBuilderException {
    Instruction prevIns = location.getHandle().getInstruction();
    if (prevIns instanceof LDC || prevIns instanceof GETSTATIC)
        return true;
    if (prevIns instanceof InvokeInstruction) {
        String methodName = ((InvokeInstruction) prevIns).getMethodName(cpg);
        if (methodName.startsWith("to") && methodName.endsWith("String") && methodName.length() > 8)
            return true;
    }
    if (prevIns instanceof AALOAD) {
        CFG cfg = classContext.getCFG(method);

        Location prev = getPreviousLocation(cfg, location, true);
        if (prev != null) {
            Location prev2 = getPreviousLocation(cfg, prev, true);
            if (prev2 != null && prev2.getHandle().getInstruction() instanceof GETSTATIC) {
                GETSTATIC getStatic = (GETSTATIC) prev2.getHandle().getInstruction();
                if (getStatic.getSignature(cpg).equals("[Ljava/lang/String;"))
                    return true;
            }
        }
    }
    return false;
}
项目:Android_Code_Arbiter    文件:TaintFrameModelingVisitor.java   
@Override
public void visitAALOAD(AALOAD obj) {
    try {
        getFrame().popValue(); // array index
        // just transfer the taint from array to value at any index
    } catch (DataflowAnalysisException ex) {
        throw new InvalidBytecodeException("Not enough values on the stack", ex);
    }
}
项目:cashmere    文件:MethodGen.java   
private boolean isArrayLoad(Instruction instruction) {
return instruction instanceof AALOAD || instruction instanceof BALOAD || 
    instruction instanceof CALOAD || instruction instanceof DALOAD ||
    instruction instanceof FALOAD || instruction instanceof IALOAD ||
    instruction instanceof LALOAD || instruction instanceof SALOAD;
   }
项目:cn1    文件:JavaByteCodeOutputProcess.java   
@SuppressWarnings("unused")
// Called using reflection
private Instruction createInstructionAaload(Element inst) throws IllegalXMLVMException {
    return new AALOAD();
}