From c50aa2b95c31d00ee0a56e9c774d77a785708e84 Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Wed, 1 Oct 2025 01:57:01 -0700 Subject: [PATCH] resinator: Sync with upstream, fix an alignment problem --- lib/compiler/resinator/compile.zig | 2 +- lib/compiler/resinator/preprocess.zig | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/compiler/resinator/compile.zig b/lib/compiler/resinator/compile.zig index 986740798d..fbb3797fde 100644 --- a/lib/compiler/resinator/compile.zig +++ b/lib/compiler/resinator/compile.zig @@ -695,7 +695,7 @@ pub const Compiler = struct { } try file_reader.seekTo(entry.data_offset_from_start_of_file); - var header_bytes = (file_reader.interface.takeArray(16) catch { + var header_bytes: [16]u8 align(@alignOf(ico.BitmapHeader)) = (file_reader.interface.takeArray(16) catch { return self.iconReadError( error.UnexpectedEOF, filename_utf8, diff --git a/lib/compiler/resinator/preprocess.zig b/lib/compiler/resinator/preprocess.zig index a4f3dfd2f2..298dd49999 100644 --- a/lib/compiler/resinator/preprocess.zig +++ b/lib/compiler/resinator/preprocess.zig @@ -19,7 +19,7 @@ pub fn preprocess( var driver: aro.Driver = .{ .comp = comp, .diagnostics = comp.diagnostics, .aro_name = "arocc" }; defer driver.deinit(); - var macro_buf: std.ArrayListUnmanaged(u8) = .empty; + var macro_buf: std.ArrayList(u8) = .empty; defer macro_buf.deinit(comp.gpa); var discard_buffer: [64]u8 = undefined; @@ -66,9 +66,7 @@ pub fn preprocess( if (hasAnyErrors(comp)) return error.PreprocessError; - pp.prettyPrintTokens(writer, .result_only) catch |err| switch (err) { - error.WriteFailed => return error.OutOfMemory, - }; + try pp.prettyPrintTokens(writer, .result_only); if (maybe_dependencies) |dependencies| { for (comp.sources.values()) |comp_source| {