|
|
@ -79,8 +79,8 @@ pub const TrapCode = enum(u8) { |
|
|
|
pub const Trap = struct { |
|
|
|
pub const Trap = struct { |
|
|
|
/// Creates a new trap. |
|
|
|
/// Creates a new trap. |
|
|
|
/// The `Trap` returned is owned by the caller. |
|
|
|
/// The `Trap` returned is owned by the caller. |
|
|
|
pub fn init(message: []const u8) Trap { |
|
|
|
pub fn init(message: [:0]const u8) Trap { |
|
|
|
return wasmtime_trap_new(message.ptr, message.len); |
|
|
|
return wasmtime_trap_new(message.ptr, message.len + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn copy(self: *const Trap) Trap { |
|
|
|
pub fn copy(self: *const Trap) Trap { |
|
|
|