push(newValue); return; push(result); return; } else if (seen == Const.INVOKEINTERFACE && "getQueryString".equals(methodName) result.source = XFactory.createReferencedXMethod(dbc); result.setPC(dbc.getPC()); push(result); return; } else if (seen == Const.INVOKEINTERFACE && "getHeader".equals(methodName) result.source = XFactory.createReferencedXMethod(dbc); result.setPC(dbc.getPC()); push(result); return; } else if (seen == Const.INVOKESTATIC && "asList".equals(methodName) && "java/util/Arrays".equals(clsName)) { push(result); return; } else if (seen == Const.INVOKESTATIC && "(Ljava/util/List;)Ljava/util/List;".equals(signature) if (JAVA_UTIL_ARRAYS_ARRAY_LIST.equals(requestParameter.getSignature())) { Item result = new Item(JAVA_UTIL_ARRAYS_ARRAY_LIST); push(result); return; push(requestParameter); // fall back to standard logic
public void replaceTop(Item newTop) { pop(); push(newTop); }
private void handleDcmp(int opcode) { Item it = pop(); Item it2 = pop(); if ((it.getConstant() != null) && it2.getConstant() != null) { double d = constantToDouble(it); double d2 = constantToDouble(it2); if (Double.isNaN(d) || Double.isNaN(d2)) { if (opcode == Const.DCMPG) { push(new Item("I", Integer.valueOf(1))); } else { push(new Item("I", Integer.valueOf(-1))); } } if (d2 < d) { push(new Item("I", Integer.valueOf(-1))); } else if (d2 > d) { push(new Item("I", Integer.valueOf(1))); } else { push(new Item("I", Integer.valueOf(0))); } } else { push(new Item("I")); } }
private void handleFcmp(int opcode) { Item it = pop(); Item it2 = pop(); if ((it.getConstant() != null) && it2.getConstant() != null) { float f = constantToFloat(it); float f2 = constantToFloat(it2); if (Float.isNaN(f) || Float.isNaN(f2)) { if (opcode == Const.FCMPG) { push(new Item("I", Integer.valueOf(1))); } else { push(new Item("I", Integer.valueOf(-1))); } } if (f2 < f) { push(new Item("I", Integer.valueOf(-1))); } else if (f2 > f) { push(new Item("I", Integer.valueOf(1))); } else { push(new Item("I", Integer.valueOf(0))); } } else { push(new Item("I")); } }
private void pushByConstant(DismantleBytecode dbc, Constant c) { if (c instanceof ConstantClass) { push(new Item("Ljava/lang/Class;", ((ConstantClass) c).getConstantValue(dbc.getConstantPool()))); } else if (c instanceof ConstantInteger) { push(new Item("I", Integer.valueOf(((ConstantInteger) c).getBytes()))); } else if (c instanceof ConstantString) { int s = ((ConstantString) c).getStringIndex(); push(new Item("Ljava/lang/String;", getStringFromIndex(dbc, s))); } else if (c instanceof ConstantFloat) { push(new Item("F", Float.valueOf(((ConstantFloat) c).getBytes()))); } else if (c instanceof ConstantDouble) { push(new Item("D", Double.valueOf(((ConstantDouble) c).getBytes()))); } else if (c instanceof ConstantLong) { push(new Item("J", Long.valueOf(((ConstantLong) c).getBytes()))); } else { throw new UnsupportedOperationException("StaticConstant type not expected"); } }
private void handleLcmp() { Item it = pop(); Item it2 = pop(); if ((it.getConstant() != null) && it2.getConstant() != null) { long l = constantToLong(it); long l2 = constantToLong(it2); if (l2 < l) { push(new Item("I", Integer.valueOf(-1))); } else if (l2 > l) { push(new Item("I", Integer.valueOf(1))); } else { push(new Item("I", Integer.valueOf(0))); } } else { push(new Item("I")); } }
private void pushBySignature(String s, DismantleBytecode dbc) { if ("V".equals(s)) { return; } Item item = new Item(s, (Object) null); if (dbc != null) { item.setPC(dbc.getPC()); } if ("B".equals(s)) { item.setSpecialKind(Item.SIGNED_BYTE); } else if ("C".equals(s)) { item.setSpecialKind(Item.NON_NEGATIVE); } push(item); }
private void pushByLocalLoad(String signature, int register) { Item oldItem = new Item(getLVValue(register)); Item newItem = oldItem; if ("Ljava/lang/Object;".equals(newItem.signature) && !"Ljava/lang/Object;".equals(signature)) { newItem = new Item(oldItem); newItem.signature = signature; } if (newItem.getRegisterNumber() < 0) { if (newItem == oldItem) { newItem = new Item(oldItem); } newItem.registerNumber = register; } push(newItem); }
private void pushByDoubleMath(int seen, Item it, Item it2) { Item result; @SpecialKind int specialKind = Item.FLOAT_MATH; if ((it.getConstant() instanceof Double) && it2.getConstant() instanceof Double) { if (seen == Const.DADD) { result = new Item("D", Double.valueOf(constantToDouble(it2) + constantToDouble(it))); } else if (seen == Const.DSUB) { result = new Item("D", Double.valueOf(constantToDouble(it2) - constantToDouble(it))); } else if (seen == Const.DMUL) { result = new Item("D", Double.valueOf(constantToDouble(it2) * constantToDouble(it))); } else if (seen == Const.DDIV) { result = new Item("D", Double.valueOf(constantToDouble(it2) / constantToDouble(it))); } else if (seen == Const.DREM) { result = new Item("D", Double.valueOf(constantToDouble(it2) % constantToDouble(it))); } else { result = new Item("D"); // ? } } else { result = new Item("D"); if (seen == Const.DDIV) { specialKind = Item.NASTY_FLOAT_MATH; } } result.setSpecialKind(specialKind); push(result); }
seen, String.valueOf(lhs), String.valueOf(rhs), context), e); push(newValue);
private void pushByFloatMath(int seen, Item it, Item it2) { Item result; @SpecialKind int specialKind = Item.FLOAT_MATH; if ((it.getConstant() instanceof Float) && it2.getConstant() instanceof Float) { if (seen == Const.FADD) { result = new Item("F", Float.valueOf(constantToFloat(it2) + constantToFloat(it))); } else if (seen == Const.FSUB) { result = new Item("F", Float.valueOf(constantToFloat(it2) - constantToFloat(it))); } else if (seen == Const.FMUL) { result = new Item("F", Float.valueOf(constantToFloat(it2) * constantToFloat(it))); } else if (seen == Const.FDIV) { result = new Item("F", Float.valueOf(constantToFloat(it2) / constantToFloat(it))); } else if (seen == Const.FREM) { result = new Item("F", Float.valueOf(constantToFloat(it2) % constantToFloat(it))); } else { result = new Item("F"); } } else { result = new Item("F"); if (seen == Const.DDIV) { specialKind = Item.NASTY_FLOAT_MATH; } } result.setSpecialKind(specialKind); push(result); }
private void pushByIntMath(DismantleBytecode dbc, int seen, Item lhs, Item rhs) { Item newValue = new Item("I"); if (lhs == null || rhs == null) { push(newValue); return; int rhsValue = constantToInt(rhs); if ((seen == Const.IDIV || seen == Const.IREM) && rhsValue == 0) { push(newValue); return; push(newValue);