From f78d3b27ca1bea33c92e2f8eae84589db28c06cb Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Fri, 7 Jan 2022 19:00:51 +0100 Subject: Increment `runtime_param_index` for zero sized parameters `runtime_param_index` is used to get the parameter type from `fn_type`, but this variable was not incremented for zero sized parameters, causing two zero sized parameters of different type to cause miss complication. --- src/Module.zig | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index 8c14f080d2..643e793206 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -4437,6 +4437,7 @@ pub fn analyzeFnBody(mod: *Module, decl: *Decl, func: *Fn, arena: Allocator) Sem const arg = try sema.addConstant(param_type, opv); sema.inst_map.putAssumeCapacityNoClobber(inst, arg); total_param_index += 1; + runtime_param_index += 1; continue; } const ty_ref = try sema.addType(param_type); -- cgit v1.2.3