@Override public BasicValue newValue(Type type) { if (type != null && type.getDescriptor().equals(VM_SECURE_RANDOM)) { return new BasicValue(type); } return super.newValue(type); } });
@Override public BasicValue newValue(Type type) { if (type == null) { return BasicValue.UNINITIALIZED_VALUE; } else if (type.getSort() == Type.VOID) { return null; } else { return new BasicValue(type); } } });
@Override public BasicValue newValue(Type type) { BasicValue basicValue = super.newValue(type); if (basicValue == BasicValue.REFERENCE_VALUE) { basicValue = new BasicValue(type); // record the exact type and not just "Ljava/lang/Object" } return basicValue; }
@Override public BasicValue newValue(final Type type) { BasicValue basicValue = super.newValue(type); if (basicValue == BasicValue.REFERENCE_VALUE) // record the exact type and not just "Ljava/lang/Object" basicValue = new BasicValue(type); return basicValue; }
@Override public BasicValue binaryOperation(AbstractInsnNode insn, BasicValue value1, BasicValue value2) throws AnalyzerException { if(insn.getOpcode() == Opcodes.AALOAD) { Type t1 = value1.getType(); if(t1 == null || t1.getSort() != Type.ARRAY) { throw new AnalyzerException(insn, "AALOAD needs an array as first parameter"); } Type resultType = Type.getType(t1.getDescriptor().substring(1)); return new BasicValue(resultType); } return super.binaryOperation(insn, value1, value2); }
@Override public BasicValue newValue(Type type) { if(type == null) { return BasicValue.UNINITIALIZED_VALUE; } if(type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) { return new BasicValue(type); } return super.newValue(type); }
@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 Value merge(final Value v, final Value w) { if (!v.equals(w)) { Type t = ((BasicValue)v).getType(); Type u = ((BasicValue)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; }
@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; }
public BasicValue newValue(Type type) { return type==null || isPrimitive(type.getSort())? super.newValue(type): type.equals(ownerType.getType())? ownerType: new BasicValue(type);
return new BasicValue(Type.getType(typeDescriptor));
Value value = pop(); if(value instanceof NewValue) { value = new BasicValue(((NewValue)value).getType());