if (!(leftOp.equals(leftRef.getBase()))) { if (DEBUG) { System.out.println("Not assigning to same array"); if (!(leftRef.getIndex() instanceof IntConstant)) { if (DEBUG) { System.out.println("Cant determine index of assignment"); IntConstant leftIndex = (IntConstant) leftRef.getIndex(); if (leftIndex.value != index) { if (DEBUG) {
public void caseArrayRef(ArrayRef v) { ((ConvertToBaf) (v.getBase())).convertToBaf(context, out); ((ConvertToBaf) (v.getIndex())).convertToBaf(context, out); ((ConvertToBaf) rvalue).convertToBaf(context, out); Unit u = Baf.v().newArrayWriteInst(v.getType()); u.addAllTagsOf(JAssignStmt.this); out.add(u); }
public void caseArrayRef(ArrayRef ar) { inArrayRef(ar); caseExprOrRefValueBox(ar.getBaseBox()); caseExprOrRefValueBox(ar.getIndexBox()); // decideCaseExprOrRef(ar.getBase()); // decideCaseExprOrRef(ar.getIndex()); outArrayRef(ar); }
private Insn buildArrayFillInsn(ArrayRef destRef, List<Value> values) { Local array = (Local) destRef.getBase(); Register arrayReg = regAlloc.asLocal(array); if (destRef.getType() instanceof BooleanType) { elementSize = 1; } else if (destRef.getType() instanceof ByteType) { elementSize = 1; } else if (destRef.getType() instanceof CharType) { elementSize = 2; } else if (destRef.getType() instanceof ShortType) { elementSize = 2; } else if (destRef.getType() instanceof IntType) { elementSize = 4; } else if (destRef.getType() instanceof FloatType) { elementSize = 4; } else if (destRef.getType() instanceof LongType) { elementSize = 8; } else if (destRef.getType() instanceof DoubleType) { elementSize = 8;
TypeNode base = hierarchy.typeNode(((Local) ref.getBase()).getType()); Value index = ref.getIndex(); TypeNode base = hierarchy.typeNode(((Local) ref.getBase()).getType()); if (lefttype instanceof ArrayType) { ArrayType atype = (ArrayType) lefttype; ref.setBase(insertCast((Local) ref.getBase(), ArrayType.v(atype.baseType, atype.numDimensions + 1), stmt)); } else { ref.setBase(insertCast((Local) ref.getBase(), ArrayType.v(lefttype, 1), stmt)); Value index = ref.getIndex();
private void handleArrayRef(ArrayRef arrayRef, AnalysisInfo out) { Value array = arrayRef.getBase(); // here we know that the array must point to an object, but the array value might be anything out.put(array, NON_NULL); // out.put(arrayRef, TOP); }
if (l instanceof ArrayRef) { ArrayRef ar = (ArrayRef) l; Local baseLocal = (Local) ar.getBase(); ArrayType arrayType = (ArrayType) localTyped.get(baseLocal); lType = arrayType.getElementType(); if ((ar.getIndex() instanceof UntypedConstant)) { UntypedIntOrFloatConstant uc = (UntypedIntOrFloatConstant) ar.getIndex(); ar.setIndex(uc.toIntConstant()); Local baseLocal = (Local) stmt.getArrayRef().getBase(); ArrayType lType = (ArrayType) localTyped.get(baseLocal); Type elemType = lType.getElementType();
if (left instanceof ArrayRef) { ArrayRef ar = (ArrayRef) left; if (ar.getIndex() == l) { doBreak = true; return; if (((ArrayRef) r).getIndex() == l) { doBreak = true; return; } else if (left instanceof ArrayRef) { ArrayRef ar = (ArrayRef) left; Type arType = ar.getType(); if (arType instanceof UnknownType) { arType = findArrayType(localDefs, stmt, 0, Collections.<Unit>emptySet());
} else if (lhs instanceof ArrayRef) { ArrayRef aref = (ArrayRef) lhs; Local base = (Local) aref.getBase(); aref.setBase((Local) this.uv.visit(aref.getBase(), at, stmt)); stmt.setRightOp(this.uv.visit(rhs, tlhs, stmt)); stmt.setLeftOp(this.uv.visit(lhs, tlhs, stmt)); } else if (rhs instanceof ArrayRef) { ArrayRef aref = (ArrayRef) rhs; Local base = (Local) aref.getBase(); aref.setBase((Local) this.uv.visit(aref.getBase(), at, stmt)); stmt.setRightOp(this.uv.visit(rhs, trhs, stmt)); } else if (rhs instanceof InstanceFieldRef) {
public void inArrayRef(ArrayRef ar) { Value index = ar.getIndex(); if (index instanceof Local) { info.setHeuristic((Local) index, infoGatheringAnalysis.ARRAYINDEX); } }
aref.getIndexBox().addTag(new ColorTag(255, 0, 0, false, "ArrayCheckTag")); } else if (res == 1) { aref.getIndexBox().addTag(new ColorTag(255, 248, 35, false, "ArrayCheckTag")); } else if (res == 2) { aref.getIndexBox().addTag(new ColorTag(255, 163, 0, false, "ArrayCheckTag")); } else if (res == 3) { aref.getIndexBox().addTag(new ColorTag(45, 255, 84, false, "ArrayCheckTag"));
TypeNode base = hierarchy.typeNode(((Local) ref.getBase()).getType()); Value index = ref.getIndex(); TypeNode base = hierarchy.typeNode(((Local) ref.getBase()).getType()); if (lefttype instanceof ArrayType) { ArrayType atype = (ArrayType) lefttype; ref.setBase(insertCast((Local) ref.getBase(), ArrayType.v(atype.baseType, atype.numDimensions + 1), stmt)); } else { ref.setBase(insertCast((Local) ref.getBase(), ArrayType.v(lefttype, 1), stmt)); Value index = ref.getIndex();
private void handleArrayRef(ArrayRef arrayRef, AnalysisInfo out) { Value array = arrayRef.getBase(); // here we know that the array must point to an object out.put(array, NON_NULL); }
Type baset = ((Local) ref.getBase()).getType(); if (baset instanceof ArrayType) { ArrayType base = (ArrayType) baset; Value index = ref.getIndex(); if (!ClassHierarchy.v().typeNode(((Local) index).getType()).hasAncestor_1(ClassHierarchy.v().INT)) { if (fix) { ref.setIndex(insertCast((Local) index, IntType.v(), stmt)); } else { error("Type Error(5)"); Type baset = ((Local) ref.getBase()).getType(); if (!(baset instanceof NullType)) { ArrayType base = (ArrayType) baset; Value index = ref.getIndex(); if (!ClassHierarchy.v().typeNode(((Local) index).getType()).hasAncestor_1(ClassHierarchy.v().INT)) { if (fix) { ref.setIndex(insertCast((Local) index, IntType.v(), stmt)); } else { error("Type Error(6)");