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

@@ -158,6 +158,7 @@ pub const SetupDispatcher = block: {
.TypeInt = opTypeInt,
.TypeMatrix = opTypeMatrix,
.TypePointer = opTypePointer,
.TypeRuntimeArray = opTypeRuntimeArray,
.TypeStruct = opTypeStruct,
.TypeVector = opTypeVector,
.TypeVoid = opTypeVoid,
@@ -1248,6 +1249,7 @@ fn opFunction(allocator: std.mem.Allocator, _: SpvWord, rt: *Runtime) RuntimeErr
rt.mod.results[function_type_id].variant.?.Type.Function.source_location = source_location;
rt.current_function = &rt.mod.results[id];
rt.current_parameter_index = 0;
}
fn opFunctionCall(allocator: std.mem.Allocator, _: SpvWord, rt: *Runtime) RuntimeError!void {
@@ -1519,6 +1521,15 @@ fn opTypePointer(_: std.mem.Allocator, _: SpvWord, rt: *Runtime) RuntimeError!vo
};
}
fn opTypeRuntimeArray(_: std.mem.Allocator, _: SpvWord, rt: *Runtime) RuntimeError!void {
const id = try rt.it.next();
rt.mod.results[id].variant = .{
.Type = .{
.RuntimeArray = .{},
},
};
}
fn opTypeStruct(allocator: std.mem.Allocator, word_count: SpvWord, rt: *Runtime) RuntimeError!void {
const id = try rt.it.next();
const members_type_word = blk: {