@Override public void visitANEWARRAY(ANEWARRAY obj) { consumeStack(obj); Type elementType = obj.getType(getCPG()); pushValue(new ArrayType(elementType, 1)); // We now have an exact type for this value. setTopOfStackIsExact(); }
@Override public ObjectType getLoadClassType( final ConstantPoolGen cpg ) { Type t = getType(cpg); if (t instanceof ArrayType) { t = ((ArrayType) t).getBasicType(); } return (t instanceof ObjectType) ? (ObjectType) t : null; } }
public ObjectType getLoadClassType(ConstantPoolGen cpg) { Type t = getType(cpg); if (t instanceof ArrayType){ t = ((ArrayType) t).getBasicType(); } return (t instanceof ObjectType)? (ObjectType) t : null; } }
/** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitANEWARRAY(ANEWARRAY o){ stack().pop(); //count stack().push( new ArrayType(o.getType(cpg), 1) ); } /** Symbolically executes the corresponding Java Virtual Machine instruction. */
@Override public void visitANEWARRAY(ANEWARRAY obj) { consumeStack(obj); Type elementType = obj.getType(getCPG()); pushValue(new ArrayType(elementType, 1)); // We now have an exact type for this value. setTopOfStackIsExact(); }
/** Symbolically executes the corresponding Java Virtual Machine instruction. */ @Override public void visitANEWARRAY(final ANEWARRAY o) { stack().pop(); //count stack().push( new ArrayType(o.getType(cpg), 1) ); } /** Symbolically executes the corresponding Java Virtual Machine instruction. */
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */ public void visitANEWARRAY(ANEWARRAY o){ indexValid(o, o.getIndex()); Constant c = cpg.getConstant(o.getIndex()); if (! (c instanceof ConstantClass)){ constraintViolated(o, "Expecting a CONSTANT_Class operand, but found a '"+c+"'."); } Type t = o.getType(cpg); if (t instanceof ArrayType){ int dimensions = ((ArrayType) t).getDimensions(); if (dimensions >= 255){ constraintViolated(o, "Not allowed to create an array with more than 255 dimensions."); } } }
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override public void visitANEWARRAY(final ANEWARRAY o) { indexValid(o, o.getIndex()); final Constant c = cpg.getConstant(o.getIndex()); if (! (c instanceof ConstantClass)) { constraintViolated(o, "Expecting a CONSTANT_Class operand, but found a '"+c+"'."); } final Type t = o.getType(cpg); if (t instanceof ArrayType) { final int dimensions = ((ArrayType) t).getDimensions(); if (dimensions > Const.MAX_ARRAY_DIMENSIONS) { constraintViolated(o, "Not allowed to create an array with more than "+ Const.MAX_ARRAY_DIMENSIONS + " dimensions;"+ " actual: " + dimensions); } } }