@Override public void visitBIPUSH(BIPUSH obj) { Taint taint = new Taint(Taint.State.SAFE); // assume each pushed byte is a char taint.setConstantValue(String.valueOf((char) obj.getValue().byteValue())); getFrame().pushValue(taint); }
InstructionHandle insertTypecheckCode(MethodGen m, InstructionList il, InstructionHandle pos, int spawnId, int exceptionPos) { ArrayList<CodeExceptionGen> catches = mtab.getCatchTypes(m, spawnId); InstructionHandle[] jumpTargets = new InstructionHandle[catches.size() + 1]; BranchHandle[] jumps = new BranchHandle[catches.size()]; for (int i = 0; i < catches.size(); i++) { CodeExceptionGen e = catches.get(i); ObjectType type = e.getCatchType(); InstructionHandle catchTarget = e.getHandlerPC(); jumpTargets[i] = il.insert(pos, new ALOAD(exceptionPos)); il.insert(pos, new INSTANCEOF(cpg.addClass(type))); il.insert(pos, new BIPUSH((byte) 1)); jumps[i] = il.insert(pos, new IF_ICMPNE(null)); il.insert(pos, new ALOAD(exceptionPos)); il.insert(pos, ins_f.createCheckCast(type)); il.insert(pos, new GOTO(catchTarget)); } InstructionHandle t = il.insert(pos, new ALOAD(exceptionPos)); il.insert(pos, new ATHROW()); jumpTargets[catches.size()] = t; for (int i = 0; i < catches.size(); i++) { jumps[i].setTarget(jumpTargets[i + 1]); } return pos; }
@SuppressWarnings("unused") // Called using reflection private Instruction createInstructionBipush(Element inst) { byte val = (byte) Integer.parseInt(inst.getAttributeValue("value")); return new BIPUSH(val); }
@Override public void visitBIPUSH(BIPUSH obj) { Number value = obj.getValue(); Constant c = new Constant(value); getFrame().pushValue(c); }