From 75821eb116035d2cde630e16db541479f7b6eeae Mon Sep 17 00:00:00 2001 From: copygirl Date: Thu, 17 Aug 2023 19:15:50 +0200 Subject: [PATCH] Fix Instance.getByIndex --- src/instance.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/instance.zig b/src/instance.zig index 451e263..57fe4a2 100644 --- a/src/instance.zig +++ b/src/instance.zig @@ -90,10 +90,10 @@ pub const Instance = extern struct { comptime T: type, ) !struct { result: T, name: []const u8 } { var result: Extern = undefined; - var name: [*]const u8 = null; + var name: [*]const u8 = undefined; var name_len: usize = undefined; return if (wasmtime_instance_export_nth(context, self, index, &name, &name_len, &result)) - .{ .result = result.as(T), .name = name[0..name_len] } + .{ .result = try result.as(T), .name = name[0..name_len] } else error.ExportNotFound; }