Class VarNode

All Implemented Interfaces:
Comparable<ValNode>, Numberable
Direct Known Subclasses:
ContextVarNode, GlobalVarNode, LocalVarNode

public abstract class VarNode extends ValNode
Represents a simple variable node in the pointer assignment graph.
Author:
Ondrej Lhotak
  • Field Details

    • variable

      protected Object variable
    • fields

      protected Map<SparkField,FieldRefNode> fields
    • interProcTarget

      protected boolean interProcTarget
    • interProcSource

      protected boolean interProcSource
  • Constructor Details

    • VarNode

      protected VarNode(Object variable, Type t)
  • Method Details

    • context

      public Context context()
    • getAllFieldRefs

      public Collection<FieldRefNode> getAllFieldRefs()
      Returns all field ref nodes having this node as their base.
    • dot

      public FieldRefNode dot(SparkField field)
      Returns the field ref node having this node as its base, and field as its field; null if nonexistent.
    • getVariable

      public Object getVariable()
      Returns the underlying variable that this node represents. Depending on what kind of synthetic variable this node models, this can be a real Jimple Local, a MethodParameter (this/return/throw/param-N), a FieldSignature (static field), a StringConstant/ClassConstant, or another Jimple Expr used as a synthetic key (e.g. a cast expression). Use getLocal() if you only care about the common "this is a real local" case.
    • getLocal

      public Local getLocal()
      Returns the underlying variable as a real Jimple Local, or null if this node does not represent one (e.g. it represents a MethodParameter, a field, or a constant — see getVariable()).
    • getMethodParameter

      public MethodParameter getMethodParameter()
      Returns the underlying variable as a MethodParameter (this/return/throw/ordinary parameter), or null if this node does not represent one — see getVariable().
    • setInterProcTarget

      public void setInterProcTarget()
      Designates this node as the potential target of a interprocedural assignment edge which may be added during on-the-fly call graph updating.
    • isInterProcTarget

      public boolean isInterProcTarget()
      Returns true if this node is the potential target of a interprocedural assignment edge which may be added during on-the-fly call graph updating.
    • setInterProcSource

      public void setInterProcSource()
      Designates this node as the potential source of a interprocedural assignment edge which may be added during on-the-fly call graph updating.
    • isInterProcSource

      public boolean isInterProcSource()
      Returns true if this node is the potential source of a interprocedural assignment edge which may be added during on-the-fly call graph updating.
    • base

      public abstract VarNode base()
    • getMethod

      public abstract SootMethod getMethod()