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
52};
53
62WASM_API_EXTERN wasm_trap_t *wasmtime_trap_new(const char *msg, size_t msg_len);
63
73WASM_API_EXTERN bool wasmtime_trap_code(const wasm_trap_t *,
75
84WASM_API_EXTERN const wasm_name_t *
86
95WASM_API_EXTERN const wasm_name_t *
97
98#ifdef __cplusplus
99} // extern "C"
100#endif
101
102#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.
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_INTEGER_OVERFLOW
An integer arithmetic operation caused an overflow.
Definition: trap.h:41
@ WASMTIME_TRAP_CODE_INTERRUPT
Execution has potentially run too long and may be interrupted.
Definition: trap.h:49
@ 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_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:51
@ 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_STACK_OVERFLOW
The current stack space was exhausted.
Definition: trap.h:28
uint8_t wasmtime_trap_code_t
Code of an instruction trap.
Definition: trap.h:21