Class GotoStmt

java.lang.Object
ghidra.pcode.struct.GotoStmt
All Implemented Interfaces:
StructuredSleigh.Stmt

public class GotoStmt extends Object
  • Field Details

    • ctx

      protected final StructuredSleigh ctx
    • parent

      protected ghidra.pcode.struct.AbstractStmt parent
  • Constructor Details

  • Method Details

    • generate

      protected StringTree generate(StructuredSleigh.Label next, StructuredSleigh.Label fall)
      Generate the Sleigh code that implements this statement
      Parameters:
      next - the label receiving control immediately after this statement is executed
      fall - the label positioned immediately after this statement in the generated code
      Returns:
      the generated Sleigh code
    • getContext

      public StructuredSleigh getContext()
      Internal: Provides the implementation of RValInternal.getContext() for AssignStmt
      Returns:
      the context
    • reparent

      protected ghidra.pcode.struct.AbstractStmt reparent(ghidra.pcode.struct.AbstractStmt newParent)
    • nearest

      protected <T extends StructuredSleigh.Stmt> T nearest(Class<T> cls)
      Get the innermost statement of the given class containing this statement

      This is used to implement "truncation" statements like "break", "continue", and "result".

      Type Parameters:
      T - the type of the statement sought
      Parameters:
      cls - the class of the statement sought
      Returns:
      the found statement or null
    • isSingleGoto

      protected boolean isSingleGoto()
      Check if the statement is or contains a single branch statement

      This is to avoid the unnecessary generation of labels forming chains of unconditional gotos.

      Returns:
      true if so, false otherwise.
    • getNext

      protected StructuredSleigh.Label getNext()
      Get the label for the statement immediately following this statement

      For statements that always fall-through, this is just {#link StructuredSleigh.FALL.

      Returns:
      the label