Wasmtime
trap.h
Go to the documentation of this file.
1
7#ifndef WASMTIME_TRAP_H
8#define WASMTIME_TRAP_H
9
10#include <wasm.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
21typedef uint8_t wasmtime_trap_code_t;
22
80};
81
90WASM_API_EXTERN wasm_trap_t *wasmtime_trap_new(const char *msg, size_t msg_len);
91
100
110WASM_API_EXTERN bool wasmtime_trap_code(const wasm_trap_t *,
112
121WASM_API_EXTERN const wasm_name_t *
123
132WASM_API_EXTERN const wasm_name_t *
134
135#ifdef __cplusplus
136} // extern "C"
137#endif
138
139#endif // WASMTIME_TRAP_H
A list of bytes.
Definition: wasm.h:102
Opaque struct representing a frame of a wasm stack trace.
Opaque struct representing a wasm trap.
const wasm_name_t * wasmtime_frame_module_name(const wasm_frame_t *)
Returns a human-readable name for this frame's module.
bool wasmtime_trap_code(const wasm_trap_t *, wasmtime_trap_code_t *code)
Attempts to extract the trap code from this trap.
wasm_trap_t * wasmtime_trap_new(const char *msg, size_t msg_len)
Creates a new trap with the given message.
const wasm_name_t * wasmtime_frame_func_name(const wasm_frame_t *)
Returns a human-readable name for this frame's function.
wasmtime_trap_code_enum
Trap codes for instruction traps.
Definition: trap.h:26
@ WASMTIME_TRAP_CODE_TABLE_OUT_OF_BOUNDS
An out-of-bounds access to a table.
Definition: trap.h:35
@ WASMTIME_TRAP_CODE_BAD_CONVERSION_TO_INTEGER
Failed float-to-int conversion.
Definition: trap.h:45
@ WASMTIME_TRAP_CODE_INTEGER_DIVISION_BY_ZERO
An integer division by zero.
Definition: trap.h:43
@ WASMTIME_TRAP_CODE_NO_ASYNC_RESULT
Definition: trap.h:76
@ WASMTIME_TRAP_CODE_INTEGER_OVERFLOW
An integer arithmetic operation caused an overflow.
Definition: trap.h:41
@ WASMTIME_TRAP_CODE_ATOMIC_WAIT_NON_SHARED_MEMORY
Definition: trap.h:60
@ WASMTIME_TRAP_CODE_ARRAY_OUT_OF_BOUNDS
Attempt to access beyond the bounds of an array.
Definition: trap.h:64
@ WASMTIME_TRAP_CODE_INTERRUPT
Execution has potentially run too long and may be interrupted.
Definition: trap.h:49
@ WASMTIME_TRAP_CODE_ALLOCATION_TOO_LARGE
Attempted an allocation that was too large to succeed.
Definition: trap.h:66
@ WASMTIME_TRAP_CODE_HEAP_MISALIGNED
Definition: trap.h:33
@ WASMTIME_TRAP_CODE_INDIRECT_CALL_TO_NULL
Indirect call to a null table entry.
Definition: trap.h:37
@ WASMTIME_TRAP_CODE_CANNOT_ENTER_COMPONENT
Definition: trap.h:73
@ WASMTIME_TRAP_CODE_MEMORY_OUT_OF_BOUNDS
An out-of-bounds memory access.
Definition: trap.h:30
@ WASMTIME_TRAP_CODE_OUT_OF_FUEL
Execution has run out of the configured fuel amount.
Definition: trap.h:57
@ WASMTIME_TRAP_CODE_ALWAYS_TRAP_ADAPTER
Definition: trap.h:55
@ WASMTIME_TRAP_CODE_NULL_REFERENCE
Call to a null reference.
Definition: trap.h:62
@ WASMTIME_TRAP_CODE_UNREACHABLE_CODE_REACHED
Code that was supposed to have been unreachable was reached.
Definition: trap.h:47
@ WASMTIME_TRAP_CODE_BAD_SIGNATURE
Signature mismatch on indirect call.
Definition: trap.h:39
@ WASMTIME_TRAP_CODE_DISABLED_OPCODE
Definition: trap.h:79
@ WASMTIME_TRAP_CODE_CAST_FAILURE
Attempted to cast a reference to a type that it is not an instance of.
Definition: trap.h:68
@ WASMTIME_TRAP_CODE_STACK_OVERFLOW
The current stack space was exhausted.
Definition: trap.h:28
wasm_trap_t * wasmtime_trap_new_code(wasmtime_trap_code_t code)
Creates a new trap from the given trap code.
uint8_t wasmtime_trap_code_t
Code of an instruction trap.
Definition: trap.h:21