diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2010-07-02 08:16:04 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2010-07-02 08:16:04 -0700 |
| commit | 113c31a26d7310293361a68ecd52726bd7f427be (patch) | |
| tree | f90030c588c895587b493094db9c6b22112a5e78 /src/rt/rust_crate_reader.cpp | |
| parent | 99be02a28d9d810d101d85f6ed552fc2754e1fd8 (diff) | |
| download | rust-113c31a26d7310293361a68ecd52726bd7f427be.tar.gz rust-113c31a26d7310293361a68ecd52726bd7f427be.zip | |
Trap missing attr forms during dwarf-scan and shut down dwarf reader, don't crash.
Diffstat (limited to 'src/rt/rust_crate_reader.cpp')
| -rw-r--r-- | src/rt/rust_crate_reader.cpp | 14 |
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); + } } } |
