From 471f3c470fdeb00596ebd0d045a5b0dab737947d Mon Sep 17 00:00:00 2001 From: zenith391 <39484230+zenith391@users.noreply.github.com> Date: Tue, 20 Dec 2022 12:54:43 +0100 Subject: [PATCH] compiler_rt: Remove errdefer in ObjectArray.init These errdefer where never executed, while this didn't bother the stage1 compiler, it caused an error in stage2. The fix is just removing those errdefer which doesn't change any behaviour because they were never executed in the first place. --- lib/compiler_rt/emutls.zig | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/compiler_rt/emutls.zig b/lib/compiler_rt/emutls.zig index c2a95f089f..57d495d8bd 100644 --- a/lib/compiler_rt/emutls.zig +++ b/lib/compiler_rt/emutls.zig @@ -86,12 +86,10 @@ const ObjectArray = struct { /// create a new ObjectArray with n slots. must call deinit() to deallocate. pub fn init(n: usize) *ObjectArray { var array = simple_allocator.alloc(ObjectArray); - errdefer simple_allocator.free(array); array.* = ObjectArray{ .slots = simple_allocator.allocSlice(?ObjectPointer, n), }; - errdefer simple_allocator.free(array.slots); for (array.slots) |*object| { object.* = null;