/** Adds a Baf instruction pushing this constant to the stack onto <code>out</code>. */ public void convertToBaf(JimpleToBafContext context, List<Unit> out) { Unit u = Baf.v().newPushInst(this); u.addAllTagsOf(context.getCurrentUnit()); out.add(u); }
public static PushInst getPushInitializer(Local l, Type t) { if (t instanceof IntegerType) { return Baf.v().newPushInst(IntConstant.v(soot.jbco.util.Rand.getInt())); } else if (t instanceof RefLikeType || t instanceof StmtAddressType) { return Baf.v().newPushInst(NullConstant.v()); } else if (t instanceof LongType) { return Baf.v().newPushInst(LongConstant.v(soot.jbco.util.Rand.getLong())); } else if (t instanceof FloatType) { return Baf.v().newPushInst(FloatConstant.v(soot.jbco.util.Rand.getFloat())); } else if (t instanceof DoubleType) { return Baf.v().newPushInst(DoubleConstant.v(soot.jbco.util.Rand.getDouble())); } return null; }
Unit pushUnit = Baf.v().newPushInst(IntConstant.v(0)); pushUnit = Baf.v().newPushInst(IntConstant.v(index++));
toinsert.add(Baf.v().newPushInst(soot.jimple.IntConstant.v(BodyBuilder.getIntegerNine()))); toinsert.add(Baf.v().newPrimitiveCastInst(IntType.v(), ByteType.v())); toinsert.add(Baf.v().newPushInst(soot.jimple.IntConstant.v(Rand.getInt() % 2 == 0 ? 9 : 3))); toinsert.add(Baf.v().newRemInst(ByteType.v())); toinserttry.add(Baf.v().newPopInst(stack.pop())); toinserttry.add(Baf.v().newPushInst(soot.jimple.NullConstant.v()));
if (first != null) { u.insertAfter(Baf.v().newStoreInst(LongType.v(), nloc), first); u.insertAfter(Baf.v().newPushInst(LongConstant.v(0)), first); } else { u.addFirst(Baf.v().newStoreInst(LongType.v(), nloc)); u.addFirst(Baf.v().newPushInst(LongConstant.v(0))); u.insertBefore(Baf.v().newPushInst(IntConstant.v(index)), unit); u.insertBefore(Baf.v().newShlInst(LongType.v()), unit); u.insertBefore(Baf.v().newPushInst(LongConstant.v(~longmask)), unit); u.insertBefore(Baf.v().newAndInst(LongType.v()), unit); u.insertBefore(Baf.v().newLoadInst(LongType.v(), nloc), unit); u.insertBefore(Baf.v().newPushInst(LongConstant.v(longmask)), unit); u.insertBefore(Baf.v().newAndInst(LongType.v()), unit); u.insertBefore(Baf.v().newXorInst(LongType.v()), unit); u.insertBefore(Baf.v().newPushInst(LongConstant.v(longmask)), unit); u.insertBefore(Baf.v().newAndInst(LongType.v()), unit); if (index > 0) { u.insertBefore(Baf.v().newPushInst(IntConstant.v(index)), unit); u.insertBefore(Baf.v().newShrInst(LongType.v()), unit); u.insertBefore(Baf.v().newPushInst(ii.getConstant()), unit); u.insertBefore(Baf.v().newLoadInst(LongType.v(), nloc), unit); u.insertBefore(Baf.v().newPushInst(LongConstant.v(longmask)), unit); u.insertBefore(Baf.v().newAndInst(LongType.v()), unit); if (index > 0) { u.insertBefore(Baf.v().newPushInst(IntConstant.v(index)), unit);
Unit pushZero = Baf.v().newPushInst(IntConstant.v(0)); Unit storZero = Baf.v().newStoreInst(IntType.v(), controlLocal); units.add(Baf.v().newPushInst(NullConstant.v())); units.add(Baf.v().newGotoInst(begUnit)); units.insertBeforeNoRedirect(Baf.v().newPushInst(IntConstant.v(Rand.getInt(3) + 1)), begUnit); units.insertBeforeNoRedirect(Baf.v().newStoreInst(IntType.v(), controlLocal), begUnit); } else {
units.insertBeforeNoRedirect(ifinst, sii); units.insertAfter(Baf.v().newThrowInst(), ifinst); units.insertAfter(Baf.v().newPushInst(NullConstant.v()), ifinst);
units.remove(u); units.insertBefore(Baf.v().newPushInst(NullConstant.v()), throwu); Unit ifunit = Baf.v().newIfCmpNeInst(RefType.v(), succ); units.insertBefore(ifunit, throwu); units.insertBefore(Baf.v().newPushInst(NullConstant.v()), throwu); units.insertBefore(Baf.v().newPushInst(NullConstant.v()), methCall); if (Rand.getInt(2) == 0) { Unit pop = Baf.v().newPopInst(BooleanType.v()); Unit iffalse = Baf.v().newIfEqInst(targ); units.insertBefore(iffalse, u); units.insertBefore(Baf.v().newPushInst(NullConstant.v()), u); Unit pop = Baf.v().newPopInst(RefType.v()); units.insertAfter(pop, u);