From 4c3a19fc2664f2a15fe07106fee4e12c5ea7f5cc Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 9 Sep 2022 23:37:50 -0700 Subject: [PATCH] sysjs: improve self-hosted compiler support Signed-off-by: Stephen Gutekanst --- libs/sysjs/src/main.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/sysjs/src/main.zig b/libs/sysjs/src/main.zig index 77b4747e..9a65723a 100644 --- a/libs/sysjs/src/main.zig +++ b/libs/sysjs/src/main.zig @@ -211,7 +211,7 @@ export fn wasmCallFunction(id: *anyopaque, args: u32, len: u32, captures: [*]Val if (builtin.zig_backend == .stage1) { obj.set("return_value", functions.items[@ptrToInt(id) - 1](obj, len, captures_slice)); } else { - var func = @ptrCast(*FunType, @alignCast(std.meta.alignment(*FunType), id)); + var func = @ptrCast(FunType, @alignCast(std.meta.alignment(FunType), id)); obj.set("return_value", func(obj, len, captures_slice)); } } @@ -260,7 +260,7 @@ pub fn createFunction(fun: FunType, captures: []Value) Function { functions.append(std.heap.page_allocator, fun) catch unreachable; return .{ .ref = js.zigCreateFunction(@intToPtr(*anyopaque, functions.items.len), captures.ptr, @intCast(u32, captures.len)) }; } - return .{ .ref = js.zigCreateFunction(&fun, captures.ptr, captures.len) }; + return .{ .ref = js.zigCreateFunction(fun, captures.ptr, captures.len) }; } pub fn constructType(t: []const u8, args: []const Value) Object {