public void caseLengthExpr(LengthExpr v) { emitValue(v.getOp()); emit("arraylength", 0); }
/** * Array Length local for example a.length w/o brackets gets length of array */ private soot.Local getSpecialArrayLengthLocal(polyglot.ast.Field field) { soot.Local localField; polyglot.ast.Receiver receiver = field.target(); if (receiver instanceof polyglot.ast.Local) { localField = getLocal((polyglot.ast.Local) receiver); } else if (receiver instanceof polyglot.ast.Expr) { localField = (soot.Local) base().createAggressiveExpr((polyglot.ast.Expr) receiver, false, false); } else { localField = generateLocal(receiver.type()); } soot.jimple.LengthExpr lengthExpr = soot.jimple.Jimple.v().newLengthExpr(localField); soot.Local retLocal = lg.generateLocal(soot.IntType.v()); soot.jimple.Stmt assign = soot.jimple.Jimple.v().newAssignStmt(retLocal, lengthExpr); body.getUnits().add(assign); Util.addLnPosTags(assign, field.position()); Util.addLnPosTags(lengthExpr.getOpBox(), field.target().position()); return retLocal; }
public void caseLengthExpr(LengthExpr v) { String oldName = varName; Value op = v.getOp(); suggestVariableName("op"); String opName = varName; op.apply(this); p.println("Value " + oldName + " = Jimple.v().newLengthExpr(" + opName + ");"); varName = oldName; }
public void caseLengthExpr(LengthExpr expr) { result = result.add(mgr.NULL_POINTER_EXCEPTION); result = result.add(mightThrow(expr.getOp())); }
public void caseLengthExpr(LengthExpr v) { returnedExpr.setValue(newLengthExpr(newExpr(v.getOp()))); }
@Override public void caseLengthExpr(LengthExpr le) { Value array = le.getOp(); constantV.setOrigStmt(origStmt); // In buggy code, the parameter could be a NullConstant. // This is why we use .asImmediate() and not .asLocal() Register arrayReg = regAlloc.asImmediate(array, constantV); stmtV.addInsn(new Insn12x(Opcode.ARRAY_LENGTH, destinationReg, arrayReg), origStmt); }
Value op = ((LengthExpr) rhs).getOp(); genset.add(op); } else if (rhs instanceof JAddExpr) {
instanceInvokeExprChecksSet.add(base); } else if (boxValue instanceof LengthExpr) { base = ((LengthExpr) boxValue).getOp(); lengthExprChecksSet.add(base); } else if (s instanceof ThrowStmt) { instanceInvokeExprChecksSet.add(base); } else if (boxValue instanceof LengthExpr) { base = ((LengthExpr) boxValue).getOp(); lengthExprChecksSet.add(base); } else if (s instanceof ThrowStmt) {
private void javafy_unop_expr(ValueBox vb) { UnopExpr uoe = (UnopExpr) vb.getValue(); javafy(uoe.getOpBox()); if (uoe instanceof LengthExpr) { vb.setValue(new DLengthExpr(((LengthExpr) uoe).getOp())); } else if (uoe instanceof NegExpr) { vb.setValue(new DNegExpr(((NegExpr) uoe).getOp())); } }
Value base = ((LengthExpr) rightOp).getOp(); ingraph.addMutualEdges(base, leftOp, 0); return;
Value base = l.getOp(); if (base instanceof IntConstant) { IntConstant ic = (IntConstant) base;
public void caseLengthExpr(LengthExpr expr) { result = result.add(mgr.NULL_POINTER_EXCEPTION); result = result.add(mightThrow(expr.getOp())); }
public void caseLengthExpr(LengthExpr expr) { result = result.add(mgr.NULL_POINTER_EXCEPTION); result = result.add(mightThrow(expr.getOp())); }
Value op = ((LengthExpr)rhs).getOp(); genset.add(op);
Value op = ((LengthExpr)rhs).getOp(); genset.add(op);