| author | |
| committer | |
| log | a9b37ac63724a79805f00b4e6966ebb8329151a2 |
| tree | 886d9da532f7fbf02001858ed8c9cc4cad9dc1d8 |
| parent | d68f39b5412e0aeb59d71c9f676221212261dc8c |
This hashmap value used to be assigned much later during `flushModule`,
which never happens if an error is returned by the backend, and
attempting to the undefined values would cause a crash.1 files changed, 2 insertions(+), 1 deletions(-)
src/codegen/c.zig+2-1| ... | ... | @@ -592,7 +592,8 @@ pub const DeclGen = struct { |
| 592 | 592 | |
| 593 | 593 | // Indicate that the anon decl should be rendered to the output so that |
| 594 | 594 | // our reference above is not undefined. |
| 595 | _ = try dg.anon_decl_deps.getOrPut(dg.gpa, decl_val); | |
| 595 | const gop = try dg.anon_decl_deps.getOrPut(dg.gpa, decl_val); | |
| 596 | if (!gop.found_existing) gop.value_ptr.* = .{}; | |
| 596 | 597 | } |
| 597 | 598 | |
| 598 | 599 | fn renderDeclValue( |