package binary

import "github.com/tetratelabs/wazero/internal/wasm/binary"

Index

Variables

var (
	ErrInvalidByte           = errors.New("invalid byte")
	ErrInvalidMagicNumber    = errors.New("invalid magic number")
	ErrInvalidVersion        = errors.New("invalid version header")
	ErrInvalidSectionID      = errors.New("invalid section id")
	ErrCustomSectionNotFound = errors.New("custom section not found")
)
var Magic = []byte{0x00, 0x61, 0x73, 0x6D}

Magic is the 4 byte preamble (literally "\0asm") of the binary format See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-magic

Functions

func DecodeModule

func DecodeModule(
	binary []byte,
	enabledFeatures api.CoreFeatures,
	memoryLimitPages uint32,
	memoryCapacityFromMax,
	dwarfEnabled, storeCustomSections bool,
) (*wasm.Module, error)

DecodeModule implements wasm.DecodeModule for the WebAssembly 1.0 (20191205) Binary Format See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-format%E2%91%A0

Source Files

code.go const_expr.go custom.go data.go decoder.go element.go errors.go export.go function.go global.go header.go import.go limits.go memory.go names.go section.go table.go value.go

Version
v1.9.0 (latest)
Published
Feb 18, 2025
Platform
linux/amd64
Imports
14 packages
Last checked
4 days ago

Tools for package owners.