Class GlobalVarNode

All Implemented Interfaces:
Comparable<ValNode>, Numberable

public class GlobalVarNode extends VarNode
Represents a simple variable node in the pointer assignment graph that is not associated with any particular method invocation. Unlike LocalVarNode, whose underlying variable (see VarNode.getVariable()) can be several different kinds of synthetic key, a GlobalVarNode's variable is always exactly one of FieldSignature (a static field), StringConstant, or ClassConstant — see PAG.makeGlobalVarNode(Object, Type). Use getFieldSignature()/getStringConstant()/getClassConstant() instead of casting VarNode.getVariable() yourself.
Author:
Ondrej Lhotak
  • Constructor Details

    • GlobalVarNode

      public GlobalVarNode(Object variable, Type t)
  • Method Details

    • base

      public VarNode base()
      Specified by:
      base in class VarNode
    • getMethod

      public SootMethod getMethod()
      Specified by:
      getMethod in class VarNode
    • getFieldSignature

      public FieldSignature getFieldSignature()
      Returns the underlying static field, or null if this node represents a constant.
    • getStringConstant

      public StringConstant getStringConstant()
      Returns the underlying string constant, or null if this node represents a field.
    • getClassConstant

      public ClassConstant getClassConstant()
      Returns the underlying class constant, or null if this node represents a field.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parameterize

      public PagNode parameterize(Parameterizer parameterizer, Context context)
      Description copied from class: PagNode
      Turns this node into its context-sensitive counterpart by calling back into the matching overload of parameterizer. Only the node kinds that can actually be parameterized (LocalVarNode, FieldRefNode, AllocNode, FieldValNode, GlobalVarNode) override this; every other node kind is not meant to reach a context parameterization step, so the default fails loudly instead of silently doing nothing.
      Overrides:
      parameterize in class PagNode