github.com/bananabytelabs/wazero@v0.0.0-20240105073314-54b22a776da8/internal/testing/binaryencoding/const_expr.go (about)

     1  package binaryencoding
     2  
     3  import (
     4  	"github.com/bananabytelabs/wazero/internal/wasm"
     5  )
     6  
     7  func encodeConstantExpression(expr wasm.ConstantExpression) (ret []byte) {
     8  	ret = append(ret, expr.Opcode)
     9  	ret = append(ret, expr.Data...)
    10  	ret = append(ret, wasm.OpcodeEnd)
    11  	return
    12  }