| ... | @@ -559,7 +559,9 @@ pub const Decl = struct { | ... | @@ -559,7 +559,9 @@ pub const Decl = struct { |
| 559 | } | 559 | } |
| 560 | if (decl.getFunction()) |func| { | 560 | if (decl.getFunction()) |func| { |
| 561 | _ = mod.align_stack_fns.remove(func); | 561 | _ = mod.align_stack_fns.remove(func); |
| 562 | _ = mod.monomorphed_funcs.remove(func); | 562 | if (func.comptime_args != null) { |
| | 563 | _ = mod.monomorphed_funcs.remove(func); |
| | 564 | } |
| 563 | func.deinit(gpa); | 565 | func.deinit(gpa); |
| 564 | gpa.destroy(func); | 566 | gpa.destroy(func); |
| 565 | } | 567 | } |
| ... | @@ -1478,6 +1480,7 @@ pub const Fn = struct { | ... | @@ -1478,6 +1480,7 @@ pub const Fn = struct { |
| 1478 | /// This is important because it may be accessed when resizing monomorphed_funcs | 1480 | /// This is important because it may be accessed when resizing monomorphed_funcs |
| 1479 | /// while this Fn has already been added to the set, but does not have the | 1481 | /// while this Fn has already been added to the set, but does not have the |
| 1480 | /// owner_decl, comptime_args, or other fields populated yet. | 1482 | /// owner_decl, comptime_args, or other fields populated yet. |
| | 1483 | /// This field is undefined if comptime_args == null. |
| 1481 | hash: u64, | 1484 | hash: u64, |
| 1482 | | 1485 | |
| 1483 | /// Relative to owner Decl. | 1486 | /// Relative to owner Decl. |