Example usage for org.objectweb.asm Opcodes IF_ACMPNE

List of usage examples for org.objectweb.asm Opcodes IF_ACMPNE

Introduction

In this page you can find the example usage for org.objectweb.asm Opcodes IF_ACMPNE.

Prototype

int IF_ACMPNE

To view the source code for org.objectweb.asm Opcodes IF_ACMPNE.

Click Source Link

Usage

From source file:serianalyzer.JVMImpl.java

License:Open Source License

/**
 * @param opcode/*from   w w  w .j a  va  2  s  .  co  m*/
 * @param label
 * @param s
 * @return
 */
static boolean handleJVMJump(int opcode, Label label, JVMStackState s) {
    boolean tainted;
    switch (opcode) {
    case Opcodes.IF_ICMPEQ:
    case Opcodes.IF_ICMPNE:
    case Opcodes.IF_ICMPLT:
    case Opcodes.IF_ICMPGE:
    case Opcodes.IF_ICMPGT:
    case Opcodes.IF_ICMPLE:
    case Opcodes.IF_ACMPEQ:
    case Opcodes.IF_ACMPNE:
        BaseType o1 = s.pop();
        BaseType o2 = s.pop();
        tainted = !(o1 != null) || !(o2 != null) || o1.isTainted() || o2.isTainted();
        break;
    case Opcodes.IFEQ:
    case Opcodes.IFNE:
    case Opcodes.IFLT:
    case Opcodes.IFGE:
    case Opcodes.IFGT:
    case Opcodes.IFLE:
    case Opcodes.IFNULL:
    case Opcodes.IFNONNULL:
        BaseType c = s.pop();
        tainted = (c == null || c.isTainted());
        break;

    case Opcodes.JSR:
        s.push(new BasicConstant(Type.INT_TYPE, label));
        tainted = false;
        break;
    case Opcodes.GOTO:
        tainted = false;
        break;
    default:
        log.warn("Unsupported opcode " + opcode); //$NON-NLS-1$
        tainted = true;
    }
    return tainted;
}

From source file:v6.java.preverifier.MethodRewriter.java

License:Open Source License

/**
 * Visit the specified instruction and do the right thing.
 * //from ww  w.  j  a  v a  2 s. c o m
 * @param method
 * @param region
 * @param insnNode
 * @throws AnalyzerException
 */
private void visitInstruction(MethodNode method, Region region, AbstractInsnNode insnNode)
        throws AnalyzerException {
    int opcode = insnNode.getOpcode();
    switch (opcode) {
    case Opcodes.JSR:
        visitJumpToSubroutine(method, region, (JumpInsnNode) insnNode);
        break;

    case Opcodes.IFEQ:
    case Opcodes.IFNE:
    case Opcodes.IFLT:
    case Opcodes.IFGE:
    case Opcodes.IFGT:
    case Opcodes.IFLE:
    case Opcodes.IF_ICMPEQ:
    case Opcodes.IF_ICMPNE:
    case Opcodes.IF_ICMPLT:
    case Opcodes.IF_ICMPGE:
    case Opcodes.IF_ICMPGT:
    case Opcodes.IF_ICMPLE:
    case Opcodes.IF_ACMPEQ:
    case Opcodes.IF_ACMPNE:
    case Opcodes.GOTO:
    case Opcodes.IFNULL:
    case Opcodes.IFNONNULL:
        visitJump(method, region, (JumpInsnNode) insnNode);
        break;

    case Opcodes.LOOKUPSWITCH:
        visitLookupSwitch(method, region, (LookupSwitchInsnNode) insnNode);
        break;

    case Opcodes.TABLESWITCH:
        visitTableSwitch(method, region, (TableSwitchInsnNode) insnNode);
        break;

    default:
        insnNode.accept(method);
    }
}