Files
subcoding/vm/operand.go

27 lines
374 B
Go
Raw Normal View History

2021-11-15 20:44:26 -10:00
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,
}
}