public boolean isAssertionHandle(InstructionHandle handle, ConstantPoolGen cpg) { Instruction ins = handle.getInstruction(); if (isAssertionInstruction(ins, cpg)) return true; if (ins instanceof SIPUSH) { int v = ((SIPUSH) ins).getValue().intValue(); if (v == 500) { Instruction next = handle.getNext().getInstruction(); if (next instanceof INVOKEINTERFACE) { INVOKEINTERFACE iInterface = (INVOKEINTERFACE) next; String className = iInterface.getClassName(cpg); String fieldName = iInterface.getMethodName(cpg); if (className.equals("javax.servlet.http.HttpServletResponse") && fieldName.equals("setStatus")) return true; } } } return false; }
@Override public void visitSIPUSH(SIPUSH obj) { Taint taint = new Taint(Taint.State.SAFE); // assume each pushed short is a char (for non-ASCII characters) taint.setConstantValue(String.valueOf((char) obj.getValue().shortValue())); getFrame().pushValue(taint); }
@Override public void visitSIPUSH(SIPUSH obj) { Number value = obj.getValue(); Constant c = new Constant(value); getFrame().pushValue(c); }