Documentation
¶
Overview ¶
Package defers implements an analysis that determines which set of defer instructions can reach each program point. For now, everything except whether the result is bounded is thrown away.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyzeProgram ¶
func AnalyzeProgram(target *loadprogram.State, l *config.LogGroup)
AnalyzeProgram runs the analysis on an entire program, and report the results to stdout.
Types ¶
type InstrIndices ¶
type InstrIndices struct { Block int // index of block in function Ins int // index of instruction in block }
InstrIndices represents instructions so that we can compare them (instructions do not know their own index).
type Results ¶
type Results struct { DeferStackBounded bool // unbounded == "bad" == false RunDeferSets map[*ssa.RunDefers]StackSet }
Results represents the results of the analysis. The analysis could be easily extended to save the results at e.g. each RunDefers or each panic point.
type Stack ¶
type Stack []InstrIndices
Stack is a representation of the runtime stack of deferred expressions (represented by a slice of the indices of instructions that generated each deferred function).