checkconst

package
v0.0.0-...-6cf66fa Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0, MIT Imports: 9 Imported by: 1

Documentation

Overview

Package checkconst checks constant values.

This analyzer supports multiple annotations: checkconst, checkoffset, checksize and checkalign. Each of these essentially checks the value of the declared constant (or the #define'ed value in the case of an assembly file) against the value seen during analysis. If this does not match, an error is emitted with the appropriate value for that constant/offset/size/alignment.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "checkconst",
	Doc:  "validates basic constants",
	Run:  run,
	FactTypes: []analysis.Fact{
		(*Constants)(nil),
	},
}

Analyzer defines the entrypoint.

Functions

This section is empty.

Types

type Constants

type Constants struct {
	Alignments map[string]int64
	Offsets    map[string]int64
	Sizes      map[string]int64
	Values     map[string]string
}

Constants contains all constant values.

func (*Constants) AFact

func (*Constants) AFact()

AFact implements analysis.Fact.AFact.

Jump to

Keyboard shortcuts

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