aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-09-25 21:07:56 +0100
committergingerBill <bill@gingerbill.org>2019-09-25 21:07:56 +0100
commitf4f6e9ad49d6992712815bc7b2e94c8333f33523 (patch)
tree8af04986c327a40bfbf2c52d3f34a9ca54f54df2 /src/ir_print.cpp
parent48ab7f876c51dfb009f8ff53d345bb575ce4fb4c (diff)
Fix -debug crash on windows caused by missing debug info for files.
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 30ad914a9..9414a2338 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -2450,11 +2450,13 @@ void print_llvm_ir(irGen *ir) {
for_array(di_index, m->debug_info.entries) {
irDebugInfo *di = m->debug_info.entries[di_index].value;
+ GB_ASSERT_MSG(di != nullptr, "Invalid irDebugInfo");
ir_fprintf(f, "!%d = ", di->id);
-
switch (di->kind) {
case irDebugInfo_CompileUnit: {
- irDebugInfo *file = *map_get(&m->debug_info, hash_pointer(di->CompileUnit.file));
+ irDebugInfo **found = map_get(&m->debug_info, hash_pointer(di->CompileUnit.file));
+ GB_ASSERT_MSG(found != nullptr, "Missing debug info for: %.*s\n", LIT(di->CompileUnit.file->fullpath));
+ irDebugInfo *file = *found;
ir_fprintf(f,
"distinct !DICompileUnit("
"language: DW_LANG_C_plus_plus" // Is this good enough?