analysis

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrLabelNotAnchored is raised when a label hasn't been placed in an
	// isa.Instructions stream
	ErrLabelNotAnchored = "label not anchored: %d"

	// ErrLabelMultipleAnchors is raised when a label has been placed more than
	// once in an isa.Instructions stream
	ErrLabelMultipleAnchors = "label anchored multiple times: %d"
)
View Source
const (
	// ErrBadStackTermination is raised when the analyzer verifies a branch
	// that ends in a non-empty state
	ErrBadStackTermination = "invalid stack end-state: %d"

	// ErrBadBranchTermination is raised when the analyzer verifies parallel
	// branches that end with a different stack size
	ErrBadBranchTermination = "branches should end in the same state"
)

Variables

This section is empty.

Functions

func CalculateStackSize

func CalculateStackSize(code isa.Instructions) (isa.Operand, isa.Operand)

CalculateStackSize returns the maximum and final depths for the stack based on the instructions provided. If the final depth is non-zero, this is usually an indication that bad instructions were encoded

func Verify

func Verify(code isa.Instructions)

Verify checks an ISA Instruction stream for validity. Specifically, it will check that jumps do not target offsets outside the instructions provided and that the stack is left in a consistent state upon exit

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL