fixing recurrent panic
All checks were successful
Build / build (push) Successful in 2m14s
Test / build (push) Successful in 7m13s

This commit is contained in:
2026-01-27 22:55:02 +01:00
parent 1ad7b644c4
commit 57de432d0b
7 changed files with 639 additions and 304 deletions

View File

@@ -99,7 +99,7 @@ pub fn init(allocator: std.mem.Allocator, source: []const SpvWord, options: Modu
.output_locations = std.ArrayList(SpvWord).empty,
.bindings = std.AutoHashMap(SpvBinding, Value).init(allocator),
});
errdefer self.deinit(allocator);
errdefer allocator.free(self.code);
op.initRuntimeDispatcher();
@@ -123,9 +123,16 @@ pub fn init(allocator: std.mem.Allocator, source: []const SpvWord, options: Modu
self.bound = self.it.next() catch return ModuleError.InvalidSpirV;
self.results = allocator.alloc(Result, self.bound) catch return ModuleError.OutOfMemory;
errdefer allocator.free(self.results);
for (self.results) |*result| {
result.* = Result.init();
}
errdefer {
for (self.results) |*result| {
result.deinit(allocator);
}
}
_ = self.it.skip(); // Skip schema