mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
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.
This commit is contained in:
parent
775b0c1347
commit
471f3c470f
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user