Files
subcoding/vm/operand.go
2021-11-22 22:19:38 -08:00

27 lines
374 B
Go

package vm
type OperandType uint8
const (
Literal OperandType = 0
FunctionMemoryIndex = 1
GlobalMemoryIndex = 2
)
type Operand struct {
Type OperandType
Reserved [3]byte
Value uint64
}
func (opr *Operand) Copy() *Operand {
if opr == nil {
return nil
}
return &Operand{
Type: opr.Type,
Value: opr.Value,
}
}