Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllPackages ¶
AllPackages returns the slice of all packages the set of functions provided as argument belong to.
Types ¶
type State ¶
type State struct { config.State // Annotations contains all the annotations of the program Annotations annotations.ProgramAnnotations // Packages store the packages initially loaded. Can be used to seek syntactic information Packages []*packages.Package // The program to be analyzed. It should be a complete buildable program (e.g. loaded by LoadProgram). Program *ssa.Program // Report contains the accumulated report information Report *config.ReportInfo // contains filtered or unexported fields }
A State is the base state for the analyses in Argot. Analyses that do not require whole-program analysis should be built with the go tools analysis framework (https://pkg.go.dev/golang.org/x/tools/go/analysis)
func (*State) IncrementAndTestAlarms ¶
IncrementAndTestAlarms increments the alarm counter in the state, and returns false if the count is larger than the MaxAlarms setting in the config.
func (*State) ReachableFunctions ¶
ReachableFunctions returns the set of reachable functions from main and init according to the CHA analysis.
func (*State) ResetAlarms ¶
func (wps *State) ResetAlarms()
ResetAlarms resets the number of alarms to 0
func (*State) ResolveCallee ¶
func (wps *State) ResolveCallee(instr ssa.CallInstruction) (map[*ssa.Function]lang.CalleeInfo, error)
ResolveCallee resolves the callee(s) at the call instruction instr. It resolves callees by first looking into static callees, and then the CHA callgraph if no static callee is found.
func (*State) TestAlarmCount ¶
TestAlarmCount tests whether the alarm count is smaller than the maximum number of alarms allowed by the configuration.