summary refs log tree commit diff
path: root/src/rt/rust_crate_reader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_crate_reader.cpp')
-rw-r--r--src/rt/rust_crate_reader.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/rt/rust_crate_reader.cpp b/src/rt/rust_crate_reader.cpp
index ece0281c5d9..fc934b983fb 100644
--- a/src/rt/rust_crate_reader.cpp
+++ b/src/rt/rust_crate_reader.cpp
@@ -258,10 +258,16 @@ rust_crate_reader::die::die(die_reader *rdr, uintptr_t off)
     dom->get_log().outdent();
   } else {
     ab = rdr->abbrevs.get_abbrev(ab_idx);
-    dom->log(rust_log::DWARF, "DIE <0x%" PRIxPTR "> abbrev 0x%"
-             PRIxPTR, off, ab_idx);
-    dom->log(rust_log::DWARF, "  tag 0x%x, has children: %d",
-             ab->tag, ab->has_children);
+    if (!ab) {
+        dom->log(rust_log::DWARF, "  bad abbrev number: 0x%"
+                 PRIxPTR, ab_idx);
+        rdr->fail();
+    } else {
+        dom->log(rust_log::DWARF, "DIE <0x%" PRIxPTR "> abbrev 0x%"
+                 PRIxPTR, off, ab_idx);
+        dom->log(rust_log::DWARF, "  tag 0x%x, has children: %d",
+                 ab->tag, ab->has_children);
+    }
   }
 }