本文整理汇总了Java中soot.jimple.internal.JAssignStmt类的典型用法代码示例。如果您正苦于以下问题:Java JAssignStmt类的具体用法?Java JAssignStmt怎么用?Java JAssignStmt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JAssignStmt类属于soot.jimple.internal包,在下文中一共展示了JAssignStmt类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: jimplify
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public void jimplify (DexBody body) {
// if (local != null && expr != null)
// throw new RuntimeException("Both local and expr are set to move.");
int dest = ((OneRegisterInstruction)instruction).getRegisterA();
// if (local != null)
// assign = Jimple.v().newAssignStmt(body.getRegisterLocal(dest), local);
// else if (expr != null)
// assign = Jimple.v().newAssignStmt(body.getRegisterLocal(dest), expr);
// else
// throw new RuntimeException("Neither local and expr are set to move.");
assign = Jimple.v().newAssignStmt(body.getRegisterLocal(dest), body.getStoreResultLocal());
setUnit(assign);
addTags(assign);
if (tag != null)
assign.addTag(tag);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ assign);
int op = (int)instruction.getOpcode().value;
JAssignStmt jassign = (JAssignStmt)assign;
DalvikTyper.v().addConstraint(assign.getLeftOpBox(), assign.getRightOpBox());
}
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:27,代码来源:MoveResultInstruction.java
示例2: jimplify
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public void jimplify (DexBody body) {
if(!(instruction instanceof Instruction12x))
throw new IllegalArgumentException("Expected Instruction12x but got: "+instruction.getClass());
Instruction12x cmpInstr = (Instruction12x)instruction;
int dest = cmpInstr.getRegisterA();
Local source = body.getRegisterLocal(cmpInstr.getRegisterB());
Value expr = getExpression(source);
assign = Jimple.v().newAssignStmt(body.getRegisterLocal(dest), expr);
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
Debug.printDbg(IDalvikTyper.DEBUG, "constraint: "+ assign);
int op = (int)instruction.getOpcode().value;
//DalvikTyper.v().captureAssign((JAssignStmt)assign, op);
JAssignStmt jass = (JAssignStmt)assign;
DalvikTyper.v().setType((expr instanceof JCastExpr) ? ((JCastExpr) expr).getOpBox() : ((UnopExpr) expr).getOpBox(), opUnType[op - 0x7b], true);
DalvikTyper.v().setType(jass.leftBox, resUnType[op - 0x7b], false);
}
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:26,代码来源:UnopInstruction.java
示例3: h2t
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
Type h2t(Unit h) {
if(h instanceof JAssignStmt){
JAssignStmt j = (JAssignStmt)h;
if(SootUtilities.isNewStmt(j)){
NewExpr ne = (NewExpr)j.rightBox.getValue();
return ne.getType();
}else if(SootUtilities.isNewArrayStmt(j)){
NewArrayExpr nae = (NewArrayExpr)j.rightBox.getValue();
return nae.getType();
}else if(SootUtilities.isNewMultiArrayStmt(j)){
JNewMultiArrayExpr jnmae = (JNewMultiArrayExpr)j.rightBox.getValue();
return jnmae.getType();
}
}
return null;
}
开发者ID:petablox-project,项目名称:petablox,代码行数:17,代码来源:SimpleCtxtsAnalysis.java
示例4: h2t
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
Type h2t(Unit h) {
if(h instanceof JAssignStmt){
JAssignStmt j = (JAssignStmt)h;
if(SootUtilities.isNewStmt(j)){
NewExpr ne = (NewExpr)j.rightBox.getValue();
return ne.getType();
}else if(SootUtilities.isNewArrayStmt(j)){
NewArrayExpr nae = (NewArrayExpr)j.rightBox.getValue();
return nae.getType();
}else if(SootUtilities.isNewMultiArrayStmt(j)){
JNewMultiArrayExpr jnmae = (JNewMultiArrayExpr)j.rightBox.getValue();
return jnmae.getType();
}
}
return null;
}
开发者ID:petablox-project,项目名称:petablox,代码行数:17,代码来源:CtxtsAnalysis.java
示例5: getType
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public static Type getType(Unit u) {
Type t=null;
if(u instanceof JAssignStmt){
JAssignStmt as = (JAssignStmt) u;
Value right=as.rightBox.getValue();
if (SootUtilities.isNewStmt(as))
t = ((JNewExpr)right).getType();
else if (SootUtilities.isNewArrayStmt(as))
t = ((JNewArrayExpr)right).getType();
else if (SootUtilities.isNewMultiArrayStmt(as))
t = ((JNewMultiArrayExpr)right).getType();
}
else {
assert (SootUtilities.isInvoke(u));
t = null;
}
return t;
}
开发者ID:petablox-project,项目名称:petablox,代码行数:19,代码来源:DomH.java
示例6: fill
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
@Override
public void fill() {
DomI domI = (DomI) doms[0];
DomV domV = (DomV) doms[2];
int numI = domI.size();
for (int iIdx = 0; iIdx < numI; iIdx++) {
Unit u = (Unit) domI.get(iIdx);
Local v = null;
if (u instanceof JAssignStmt) v = (Local)((JAssignStmt)u).leftBox.getValue();
if (v != null) {
if (v.getType() instanceof RefLikeType) {
int vIdx = domV.indexOf(v);
assert (vIdx >= 0);
add(iIdx, 0, vIdx);
}
}
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:19,代码来源:RelIinvkRet.java
示例7: fill
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public void fill() {
DomE domE = (DomE) doms[0];
DomF domF = (DomF) doms[1];
int numE = domE.size();
for (int eIdx = 0; eIdx < numE; eIdx++) {
Unit e = (Unit)domE.get(eIdx);
//jq_Field f = e.getField();
if(e instanceof JAssignStmt){
JAssignStmt j = (JAssignStmt)e;
if(j.containsFieldRef()){
SootField f = j.getFieldRef().getField();
int fIdx = domF.indexOf(f);
assert (fIdx >= 0);
add(eIdx, fIdx);
}
else if(SootUtilities.isLoadInst(j) || SootUtilities.isStoreInst(j)){
add(eIdx, 0);
}
}
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:22,代码来源:RelEF.java
示例8: visitHeapInst
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
@Override
public void visitHeapInst(Unit u) {
if (u instanceof JAssignStmt){
JAssignStmt as = (JAssignStmt) u;
if (SootUtilities.isFieldLoad(as)) {
if(as.rightBox.getValue() instanceof InstanceFieldRef)
if (!(((InstanceFieldRef)as.rightBox.getValue()).getBase() instanceof Local))
return;
}
if (SootUtilities.isFieldStore(as)) {
if(as.rightBox.getValue() instanceof InstanceFieldRef)
if (!(((InstanceFieldRef)as.leftBox.getValue()).getBase() instanceof Local))
return;
}
}
add(u);
}
开发者ID:petablox-project,项目名称:petablox,代码行数:20,代码来源:DomE.java
示例9: checkInvoke
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
/**
* Check whether current instruction is an instruction after a method invoke
*
* @param wpe
*/
private void checkInvoke(IWrappedPE<Edge, Edge> wpe) {
if (wpe.getWSE() != null) { // if wse!=null, wpe is a path edge
// immediately after a method call
IWrappedPE<Edge, Edge> cwpe = wpe.getWPE();
Unit inst = cwpe.getInst();
// TODO: Verify Empty basic block case
/*if (inst instanceof Block) { // an empty basic block
assert ((Block) inst).getHead() == null;
return;
}*/
Unit q = (Unit) inst;
if (iterAnalysis.isThreadStart(q))
return;
soot.Value ro = null;
if(q instanceof JAssignStmt){
ro = ((JAssignStmt)q).leftBox.getValue();
}
retIdx = -1;
if (ro != null && ro.getType() instanceof RefLikeType) {
retIdx = iterAnalysis.getDomVIdx((Local)ro);
}
callStack.push(cwpe);
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:30,代码来源:MetaBackAnalysis.java
示例10: fill
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
@Override
public void fill() {
ProgramRel relCheckExcludedE = (ProgramRel) ClassicProject.g().getTrgt("checkExcludedE");
relCheckExcludedE.load();
DomE domE = (DomE) doms[0];
for (Unit q : domE) {
if(q instanceof JAssignStmt){
JAssignStmt jas = (JAssignStmt)q;
if(SootUtilities.isStaticGet(jas) || SootUtilities.isStaticPut(jas))
continue;
}
if (!relCheckExcludedE.contains(q))
add(q);
}
relCheckExcludedE.close();
}
开发者ID:petablox-project,项目名称:petablox,代码行数:17,代码来源:RelQueryE.java
示例11: visitHeapInst
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public void visitHeapInst(Unit q) {
if(q instanceof JAssignStmt){
JAssignStmt j = (JAssignStmt)q;
if(SootUtilities.isStaticPut(j)){
SootField f = j.getFieldRef().getField();
if(j.leftBox.getValue().getType() instanceof RefLikeType){
if (j.rightBox.getValue() instanceof Local) {
Local r = (Local)j.rightBox.getValue();
int mIdx = domM.indexOf(ctnrMethod);
assert (mIdx >= 0);
int rIdx = domV.indexOf(r);
assert (rIdx >= 0);
int fIdx = domF.indexOf(f);
assert (fIdx >= 0);
add(mIdx, fIdx, rIdx);
}
}
}
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:21,代码来源:RelMputStatFldInst.java
示例12: visitHeapInst
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public void visitHeapInst(Unit q) {
if(q instanceof JAssignStmt){
JAssignStmt j = (JAssignStmt)q;
if(SootUtilities.isStaticPut(j)){
SootField f = j.getFieldRef().getField();
if(j.leftBox.getValue().getType() instanceof RefLikeType &&
j.rightBox.getValue() instanceof Local){
Local r = (Local)j.rightBox.getValue();
int pIdx = domP.indexOf(q);
assert (pIdx >= 0);
int rIdx = domV.indexOf(r);
assert (rIdx >= 0);
int fIdx = domF.indexOf(f);
assert (fIdx >= 0);
add(pIdx, fIdx, rIdx);
}
}
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:20,代码来源:RelPputStatFldInst.java
示例13: visitHeapInst
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public void visitHeapInst(Unit q) {
if(q instanceof JAssignStmt){
JAssignStmt j = (JAssignStmt)q;
if(SootUtilities.isStaticGet(j) &&
j.rightBox.getValue().getType() instanceof RefLikeType){
SootField f = j.getFieldRef().getField();
Local l = (Local)j.leftBox.getValue();
int pIdx = domP.indexOf(q);
assert (pIdx >= 0);
int lIdx = domV.indexOf(l);
assert (lIdx >= 0);
int fIdx = domF.indexOf(f);
assert (fIdx >= 0);
add(pIdx, lIdx, fIdx);
}
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:18,代码来源:RelPgetStatFldInst.java
示例14: visitHeapInst
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public void visitHeapInst(Unit q) {
if(q instanceof JAssignStmt){
JAssignStmt j = (JAssignStmt)q;
Type right = j.rightBox.getValue().getType();
if(SootUtilities.isStaticGet(j) && !(right instanceof PrimType)){
SootField f = j.getFieldRef().getField();
Local l = (Local)j.leftBox.getValue();
int mIdx = domM.indexOf(ctnrMethod);
assert (mIdx >= 0);
int lIdx = domV.indexOf(l);
assert (lIdx >= 0);
int fIdx = domF.indexOf(f);
assert (fIdx >= 0);
add(mIdx, lIdx, fIdx);
}
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:18,代码来源:RelMgetStatFldInst.java
示例15: fill
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public void fill() {
DomP domP = (DomP) doms[0];
DomV domV = (DomV) doms[1];
DomH domH = (DomH) doms[2];
int numH = domH.size();
for (int hIdx = 1; hIdx < numH; hIdx++) {
Unit h = (Unit) domH.get(hIdx);
int pIdx = domP.indexOf(h);
assert (pIdx >= 0);
if(h instanceof JAssignStmt){
JAssignStmt j = (JAssignStmt)h;
if(SootUtilities.isNewStmt(j) || SootUtilities.isNewArrayStmt(j)){
Local v = (Local)j.leftBox.getValue();
int vIdx = domV.indexOf(v);
assert (vIdx >= 0);
add(pIdx, vIdx, hIdx);
}
}
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:21,代码来源:RelPobjValAsgnInst.java
示例16: visitPhiInst
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public void visitPhiInst(Unit q) {
if(q instanceof JAssignStmt){
JAssignStmt j = (JAssignStmt)q;
Value left = j.leftBox.getValue();
Value right = j.rightBox.getValue();
if(right instanceof SPhiExpr && left.getType() instanceof RefLikeType){
SPhiExpr phi = (SPhiExpr)right;
Local l =(Local)left;
List<ValueUnitPair> args = phi.getArgs();
for(ValueUnitPair vu : args){
Value v = vu.getValue();
if(v instanceof Local){
add(ctnrMethod, l, (Local)v);
}
}
}
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:19,代码来源:RelMobjVarAsgnInst.java
示例17: visitCastInst
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public void visitCastInst(Unit q) {
if(q instanceof JAssignStmt){
JAssignStmt j = (JAssignStmt)q;
Value left = j.leftBox.getValue();
Value right = j.rightBox.getValue();
if(right instanceof JCastExpr){
JCastExpr jce = (JCastExpr)right;
Type t = jce.getCastType();
if(jce.getOp() instanceof Local && t instanceof RefLikeType){
Local src = (Local)jce.getOp();
Local dst = (Local)left;
int mIdx = domM.indexOf(ctnrMethod);
assert (mIdx >= 0);
int lIdx = domV.indexOf(dst);
assert (lIdx >= 0);
int tIdx = domT.indexOf(t);
assert (tIdx >= 0);
int rIdx = domV.indexOf(src);
assert (rIdx >= 0);
add(mIdx, lIdx, tIdx, rIdx);
}
}
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:25,代码来源:RelMcheckCastInst.java
示例18: isRelevant
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public static boolean isRelevant(Unit q) {
if(q instanceof JAssignStmt){
JAssignStmt as=(JAssignStmt)q;
return
SootUtilities.isFieldLoad(as)||
SootUtilities.isStoreInst(as) ||
SootUtilities.isNewStmt(as)||
SootUtilities.isLoadInst(as)||
SootUtilities.isFieldStore(as) ||
SootUtilities.isStaticGet(as)||
SootUtilities.isStaticPut(as) ||
SootUtilities.isInvoke(as) ||
SootUtilities.isNewArrayStmt(as);
}
return
SootUtilities.isInvoke(q) ||
(q instanceof JReturnStmt || q instanceof JReturnVoidStmt)||
q instanceof MonitorStmt;
}
开发者ID:petablox-project,项目名称:petablox,代码行数:20,代码来源:Instrumentor.java
示例19: removeMoves
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
public static void removeMoves(SootMethod m) {
List<Unit> moves = new ArrayList<Unit>();
Body b = m.retrieveActiveBody();
PatchingChain<Unit> upc = b.getUnits();
Iterator<Unit> uit = upc.iterator();
while (uit.hasNext()) {
Unit u = (Unit)uit.next();
if (!(u instanceof IdentityStmt) && (u instanceof JAssignStmt) && SootUtilities.isMoveInst((JAssignStmt)u))
moves.add(u);
}
for (int i = 0; i < moves.size(); i++) {
JAssignStmt curr = (JAssignStmt)moves.get(i);
Local left = (Local)curr.leftBox.getValue();
Local right = (Local)curr.rightBox.getValue();
Unit currSucc = upc.getSuccOf(curr);
moveLabel(m, curr, currSucc);
upc.remove(curr);
List<ValueBox> useList = b.getUseBoxes();
for (int j = 0; j < useList.size(); j++) {
if (useList.get(j).getValue() == left)
useList.get(j).setValue(right);
}
}
}
开发者ID:petablox-project,项目名称:petablox,代码行数:26,代码来源:SSAUtilities.java
示例20: getTaintsForMethod
import soot.jimple.internal.JAssignStmt; //导入依赖的package包/类
@Override
public Set<AccessPath> getTaintsForMethod(Stmt stmt, AccessPath taintedPath) {
// method add + added element is tainted -> whole list is tainted
if(stmt.getInvokeExpr().getMethod().getSubSignature().equals("boolean add(java.lang.Object)"))
if (taintedPath.getPlainValue().equals(stmt.getInvokeExpr().getArg(0)))
return Collections.singleton(new AccessPath(((InstanceInvokeExpr) stmt.getInvokeExprBox().getValue()).getBase()));
// method get + whole list is tainted -> returned element is tainted
if(stmt.getInvokeExpr().getMethod().getSubSignature().equals("java.lang.Object get(int)"))
if (stmt.getInvokeExpr() instanceof InstanceInvokeExpr) {
InstanceInvokeExpr iiExpr = (InstanceInvokeExpr) stmt.getInvokeExpr();
if (taintedPath.getPlainValue().equals(iiExpr.getBase()))
if(stmt instanceof JAssignStmt)
return Collections.singleton(new AccessPath(((JAssignStmt)stmt).getLeftOp()));
}
// For the moment, we don't implement static taints on wrappers. Pass it on
// not to break anything
if(taintedPath.isStaticFieldRef())
return Collections.singleton(taintedPath);
return Collections.emptySet();
}
开发者ID:0-14N,项目名称:soot-inflow,代码行数:24,代码来源:ListExampleWrapper.java
注:本文中的soot.jimple.internal.JAssignStmt类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论