Fix Instance.getByIndex

main
copygirl 1 year ago
parent 0d91422f54
commit 75821eb116
  1. 4
      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;
}

Loading…
Cancel
Save