Skip to content

Commit b96c551

Browse files
committed
Fix alignment on Linux
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
1 parent d5afb26 commit b96c551

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Lua.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ pub fn setCallbacks(self: Self, callbacks: anytype) void {
295295

296296
// Store instance pointer in userdata if it's a pointer
297297
if (is_instance) {
298-
cb.userdata = @ptrCast(@constCast(callbacks));
298+
// Ensure the pointer is properly aligned before storing
299+
cb.userdata = @ptrCast(@alignCast(callbacks));
299300
} else {
300301
cb.userdata = null;
301302
}

0 commit comments

Comments
 (0)