1 19 20 package soot.jimple.spark.pag; 21 import soot.jimple.spark.*; 22 import soot.*; 23 import soot.jimple.spark.sets.PointsToSetInternal; 24 25 28 public class FieldRefNode extends ValNode { 29 30 public VarNode getBase() { return base; } 31 public Node getReplacement() { 32 if( replacement == this ) { 33 if( base.replacement == base ) return this; 34 Node baseRep = base.getReplacement(); 35 FieldRefNode newRep = pag.makeFieldRefNode( (VarNode) baseRep, field ); 36 newRep.mergeWith( this ); 37 return replacement = newRep.getReplacement(); 38 } else { 39 return replacement = replacement.getReplacement(); 40 } 41 } 42 43 public SparkField getField() { return field; } 44 public String toString() { 45 return "FieldRefNode "+getNumber()+" "+base+"."+field; 46 } 47 48 49 50 FieldRefNode( PAG pag, VarNode base, SparkField field ) { 51 super( pag, null ); 52 if( field == null ) throw new RuntimeException ( "null field" ); 53 this.base = base; 54 this.field = field; 55 base.addField( this, field ); 56 pag.getFieldRefNodeNumberer().add( this ); 57 } 58 59 60 61 protected VarNode base; 62 protected SparkField field; 63 } 64 65 | Popular Tags |