Class JvmStackLocation

java.lang.Object
proguard.analysis.cpa.jvm.witness.JvmMemoryLocation
proguard.analysis.cpa.jvm.witness.JvmStackLocation

public class JvmStackLocation extends JvmMemoryLocation
The JvmStackLocation is a memory location at the operand stack. Indexing starts from the top of the stack.
  • Field Details

    • index

      public final int index
  • Constructor Details

    • JvmStackLocation

      public JvmStackLocation(int index)
      Create a stack location.
      Parameters:
      index - a stack element index from the top
  • Method Details

    • extractValueOrDefault

      public <T extends AbstractState<T>> T extractValueOrDefault(JvmAbstractState<T> jvmState, T defaultValue)
      Description copied from class: JvmMemoryLocation
      Given a JVM state, extract its content in the position represented by this JvmMemoryLocation.
      Specified by:
      extractValueOrDefault in class JvmMemoryLocation
      Type Parameters:
      T - The type of the states contained in the JVM state. e.g., for taint analysis this would be a SetAbstractState containing the taints and for value analysis a ValueAbstractState.
      Parameters:
      jvmState - The state from which the value is extracted.
      defaultValue - The value returned if it's not possible to extract the value.
      Returns:
      The value from the JVM abstract state for the memory location represented by this object. Or default value if not possible.
    • getIndex

      public int getIndex()
      Returns the stack index from the top.
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in class JvmMemoryLocation
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class JvmMemoryLocation
    • toString

      public String toString()
      Specified by:
      toString in class JvmMemoryLocation