@Override public BasicValue merge(final BasicValue v, final BasicValue w) { if (!v.equals(w)) { return BasicValue.UNINITIALIZED_VALUE; } return v; } }
protected boolean isSubTypeOf(final BasicValue value, final BasicValue expected) { return value.equals(expected); } }
if (opcode == MULTIANEWARRAY) { for (int i = 0; i < values.size(); ++i) { if (!BasicValue.INT_VALUE.equals(values.get(i))) { throw new AnalyzerException(insn, null, BasicValue.INT_VALUE, values.get(i));
@Override public BasicValue merge(BasicValue v, BasicValue w) { if (!v.equals(w)) { Type t = v.getType(); Type u = w.getType(); if (t != null && (t.getSort() == Type.OBJECT || t.getSort() == Type.ARRAY)) { if (u != null && (u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY)) { if ("Lnull;".equals(t.getDescriptor())) { return w; } if ("Lnull;".equals(u.getDescriptor())) { return v; } if (isAssignableFrom(t, u)) { return v; } if (isAssignableFrom(u, t)) { return w; } return new BasicValue(inheritanceLookup.getCommonSuperType(t, u)); } } return BasicValue.UNINITIALIZED_VALUE; } return v; }
@Override public BasicValue merge(BasicValue v, BasicValue w) { if (!v.equals(w)) { Type t = v.getType(); Type u = w.getType(); if (t != null && (t.getSort() == Type.OBJECT || t.getSort() == Type.ARRAY)) { if (u != null && (u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY)) { if ("Lnull;".equals(t.getDescriptor())) { return w; } if ("Lnull;".equals(u.getDescriptor())) { return v; } if (isAssignableFrom(t, u)) { return v; } if (isAssignableFrom(u, t)) { return w; } return new BasicValue(inheritanceLookup.getCommonSuperType(t, u)); } } return BasicValue.UNINITIALIZED_VALUE; } return v; }
@Override public BasicValue merge(BasicValue v, BasicValue w) { if (!v.equals(w)) { Type t = v.getType(); Type u = w.getType(); if (t != null && (t.getSort() == Type.OBJECT || t.getSort() == Type.ARRAY)) { if (u != null && (u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY)) { if ("Lnull;".equals(t.getDescriptor())) { return w; } if ("Lnull;".equals(u.getDescriptor())) { return v; } if (isAssignableFrom(t, u)) { return v; } if (isAssignableFrom(u, t)) { return w; } return new BasicValue(inheritanceLookup.getCommonSuperType(t, u)); } } return BasicValue.UNINITIALIZED_VALUE; } return v; }
@Override public BasicValue merge(BasicValue v, BasicValue w) { if (!v.equals(w)) { Type t = v.getType(); Type u = w.getType(); if (t != null && (t.getSort() == Type.OBJECT || t.getSort() == Type.ARRAY)) { if (u != null && (u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY)) { if ("Lnull;".equals(t.getDescriptor())) { return w; } if ("Lnull;".equals(u.getDescriptor())) { return v; } if (isAssignableFrom(t, u)) { return v; } if (isAssignableFrom(u, t)) { return w; } return new BasicValue(inheritanceLookup.getCommonSuperType(t, u)); } } return BasicValue.UNINITIALIZED_VALUE; } return v; }
throw new AnalyzerException(insn, "First argument", "a " + expected1 + " array reference", value1); } else if (!BasicValue.INT_VALUE.equals(value2)) { throw new AnalyzerException(insn, "Second argument", BasicValue.INT_VALUE, value2);
case ASTORE: if (!value.isReference() && !BasicValue.RETURNADDRESS_VALUE.equals(value)) { throw new AnalyzerException(insn, null, "an object reference or a return address", value);
@Override public BasicValue merge(final BasicValue v, final BasicValue w) { if (!v.equals(w)) { Type t = v.getType(); Type u = w.getType();
@Override public BasicValue newValue(final Type type) { if (type == null) { return BasicValue.UNINITIALIZED_VALUE; } boolean isArray = type.getSort() == Type.ARRAY; if (isArray) { switch (type.getElementType().getSort()) { case Type.BOOLEAN: case Type.CHAR: case Type.BYTE: case Type.SHORT: return new BasicValue(type); } } BasicValue v = super.newValue(type); if (BasicValue.REFERENCE_VALUE.equals(v)) { if (isArray) { v = newValue(type.getElementType()); String desc = v.getType().getDescriptor(); for (int i = 0; i < type.getDimensions(); ++i) { desc = '[' + desc; } v = new BasicValue(Type.getType(desc)); } else { v = new BasicValue(type); } } return v; }
@Override public BasicValue merge(BasicValue v, BasicValue w) { if (!v.equals(w)) { if(v.isReference() && w.isReference()) { int dimensions = 0;