soot.Body.getUseAndDefBoxes()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(177)

本文整理了Java中soot.Body.getUseAndDefBoxes()方法的一些代码示例,展示了Body.getUseAndDefBoxes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.getUseAndDefBoxes()方法的具体详情如下:
包路径:soot.Body
类名称:Body
方法名:getUseAndDefBoxes

Body.getUseAndDefBoxes介绍

[英]Returns a list of boxes corresponding to Values either used or defined in any unit of this Body.
[中]返回与此正文的任何单位中使用或定义的值相对应的框列表。

代码示例

代码示例来源:origin: Sable/soot

@Override
protected Set<Set<Value>> entryInitialFlow() {
 // initially all values only alias themselves
 Set<Set<Value>> res = new HashSet<Set<Value>>();
 for (ValueBox vb : body.getUseAndDefBoxes()) {
  res.add(Collections.singleton(vb.getValue()));
 }
 return res;
}

代码示例来源:origin: Sable/soot

@Override
/** Verifies that a ValueBox is not used in more than one place. */
public void validate(Body body, List<ValidationException> exception) {
 Set<ValueBox> set = newSetFromMap(new IdentityHashMap<ValueBox, Boolean>());
 for (ValueBox vb : body.getUseAndDefBoxes()) {
  if (set.add(vb)) {
   continue;
  }
  exception.add(new ValidationException(vb, "Aliased value box : " + vb + " in " + body.getMethod()));
  for (Unit u : body.getUnits()) {
   System.err.println(u);
  }
 }
}

代码示例来源:origin: Sable/soot

@Override
protected Map<Value, Parity> newInitialFlow() {
 Map<Value, Parity> initMap = new HashMap<Value, Parity>();
 for (Local l : g.getBody().getLocals()) {
  Type t = l.getType();
  // System.out.println("next local: "+next);
  if ((t instanceof IntegerType) || (t instanceof LongType)) {
   initMap.put(l, BOTTOM);
  }
 }
 for (ValueBox vb : g.getBody().getUseAndDefBoxes()) {
  Value val = vb.getValue();
  if (val instanceof ArithmeticConstant) {
   initMap.put(val, getParity(initMap, val));
  }
 }
 if (Options.v().interactive_mode()) {
  updateBeforeFilterMap();
 }
 return initMap;
}

代码示例来源:origin: Sable/soot

return;
for (Iterator<ValueBox> bIt = m.retrieveActiveBody().getUseAndDefBoxes().iterator(); bIt.hasNext();) {
 final ValueBox b = bIt.next();
 Value v = b.getValue();

代码示例来源:origin: Sable/soot

List<ValueBox> vbList = b.getUseAndDefBoxes();

代码示例来源:origin: Sable/soot

for (Iterator vbIt = body.getUseAndDefBoxes().iterator(); vbIt.hasNext();) {
 final ValueBox vb = (ValueBox) vbIt.next();
 Value v = vb.getValue();

代码示例来源:origin: com.bugvm/bugvm-soot

/** Verifies that a ValueBox is not used in more than one place. */
public void validateValueBoxes()
{
  List<ValueBox> l = getUseAndDefBoxes();
  for( int i = 0; i < l.size(); i++ ) {
    for( int j = 0; j < l.size(); j++ ) {
      if( i == j ) continue;
      if( l.get(i) == l.get(j) ) {
        System.err.println("Aliased value box : "+l.get(i)+" in "+getMethod());
        for( Iterator<Unit> uIt = getUnits().iterator(); uIt.hasNext(); ) {
          final Unit u = uIt.next();
          System.err.println(""+u);
        }
        throw new RuntimeException("Aliased value box : "+l.get(i)+" in "+getMethod());
      }
    }
  }
}

代码示例来源:origin: ibinti/bugvm

/** Verifies that a ValueBox is not used in more than one place. */
public void validateValueBoxes()
{
  List<ValueBox> l = getUseAndDefBoxes();
  for( int i = 0; i < l.size(); i++ ) {
    for( int j = 0; j < l.size(); j++ ) {
      if( i == j ) continue;
      if( l.get(i) == l.get(j) ) {
        System.err.println("Aliased value box : "+l.get(i)+" in "+getMethod());
        for( Iterator<Unit> uIt = getUnits().iterator(); uIt.hasNext(); ) {
          final Unit u = uIt.next();
          System.err.println(""+u);
        }
        throw new RuntimeException("Aliased value box : "+l.get(i)+" in "+getMethod());
      }
    }
  }
}

代码示例来源:origin: ibinti/bugvm

protected Object newInitialFlow()
{
  HashMap<Value, String> initMap = new HashMap<Value, String>();

  Chain locals = g.getBody().getLocals();
  Iterator it = locals.iterator();
  while (it.hasNext()) {
    Local next = (Local)it.next();
    //System.out.println("next local: "+next);
    if ((next.getType() instanceof IntegerType) || (next.getType() instanceof LongType)){
      initMap.put(next, BOTTOM);
    }
  }

  Iterator boxIt = g.getBody().getUseAndDefBoxes().iterator();
  while (boxIt.hasNext()){
    Value val = ((ValueBox)boxIt.next()).getValue();
    if (val instanceof ArithmeticConstant) {
      initMap.put(val, getParity(initMap, val));
    }
  }
  if (Options.v().interactive_mode()){
    updateBeforeFilterMap();
  }
  
  return initMap;
}

代码示例来源:origin: com.bugvm/bugvm-soot

protected Object newInitialFlow()
{
  HashMap<Value, String> initMap = new HashMap<Value, String>();

  Chain locals = g.getBody().getLocals();
  Iterator it = locals.iterator();
  while (it.hasNext()) {
    Local next = (Local)it.next();
    //System.out.println("next local: "+next);
    if ((next.getType() instanceof IntegerType) || (next.getType() instanceof LongType)){
      initMap.put(next, BOTTOM);
    }
  }

  Iterator boxIt = g.getBody().getUseAndDefBoxes().iterator();
  while (boxIt.hasNext()){
    Value val = ((ValueBox)boxIt.next()).getValue();
    if (val instanceof ArithmeticConstant) {
      initMap.put(val, getParity(initMap, val));
    }
  }
  if (Options.v().interactive_mode()){
    updateBeforeFilterMap();
  }
  
  return initMap;
}

代码示例来源:origin: com.bugvm/bugvm-soot

for( Iterator vbIt = body.getUseAndDefBoxes().iterator(); vbIt.hasNext(); ) {
  final ValueBox vb = (ValueBox) vbIt.next();
  Value v = vb.getValue();

代码示例来源:origin: ibinti/bugvm

for( Iterator vbIt = body.getUseAndDefBoxes().iterator(); vbIt.hasNext(); ) {
  final ValueBox vb = (ValueBox) vbIt.next();
  Value v = vb.getValue();

相关文章