verify

package
v0.0.0-...-ecbd380 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package verify contains a symbolic verifier to check if registers are allocated correctly

Index

Constants

This section is empty.

Variables

View Source
var ErrIllegalAssignment = errors.New("illegal register assignment in two operand instruction")
View Source
var ErrMissingCopy = errors.New("missing copy of block parameter")
View Source
var ErrNoRegAssigned = errors.New("no register assigned to a variable")
View Source
var ErrWrongValueInReg = errors.New("attempt to read wrong value from register")

Functions

func Verify

func Verify(fn *ir.Func) []error

Verify executes the function symbolically, tracking which values are in which registers. Each block is executed with each permutation of input values, which are hashed to ensure the block isn't executed twice with the same input parameters, so that it will eventually halt.

This verifier tries not to rely on liveness analysis and tries to execute the code from the beginning to the end in order to be very different from the way the register allocator works, thus increasing the likelihood of catching bugs.

This verifier wasn't really designed to be fast, since it probably won't need to run in production. It's mainly for catching bugs in tests / development. But if tests end up slow, this could be optimized.

Types

This section is empty.

Jump to

Keyboard shortcuts

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