aboutsummaryrefslogtreecommitdiff
path: root/src/rt
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-07-20 17:42:17 -0700
committerGraydon Hoare <[email protected]>2010-07-20 17:42:49 -0700
commitbf3528342a932dd0d523d259ca71b94431703ba9 (patch)
tree207f1179555f62ce80e3f6ae6cdc730743d3cfc7 /src/rt
parentMake bound functions have the right types (diff)
downloadrust-bf3528342a932dd0d523d259ca71b94431703ba9.tar.xz
rust-bf3528342a932dd0d523d259ca71b94431703ba9.zip
Be a little more careful before assuming we have crate debuginfo and abbrevs to read.
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_crate.cpp16
-rw-r--r--src/rt/rust_crate_reader.cpp2
2 files changed, 13 insertions, 5 deletions
diff --git a/src/rt/rust_crate.cpp b/src/rt/rust_crate.cpp
index 36978270..ced6aaf4 100644
--- a/src/rt/rust_crate.cpp
+++ b/src/rt/rust_crate.cpp
@@ -47,14 +47,22 @@ rust_crate::mem_area::mem_area(rust_dom *dom, uintptr_t pos, size_t sz)
rust_crate::mem_area
rust_crate::get_debug_info(rust_dom *dom) const {
- return mem_area(dom, ((uintptr_t)this + debug_info_off),
- debug_info_sz);
+ if (debug_info_off)
+ return mem_area(dom,
+ ((uintptr_t)this + debug_info_off),
+ debug_info_sz);
+ else
+ return mem_area(dom, 0, 0);
}
rust_crate::mem_area
rust_crate::get_debug_abbrev(rust_dom *dom) const {
- return mem_area(dom, ((uintptr_t)this + debug_abbrev_off),
- debug_abbrev_sz);
+ if (debug_abbrev_off)
+ return mem_area(dom,
+ ((uintptr_t)this + debug_abbrev_off),
+ debug_abbrev_sz);
+ else
+ return mem_area(dom, 0, 0);
}
//
diff --git a/src/rt/rust_crate_reader.cpp b/src/rt/rust_crate_reader.cpp
index 03d64b4b..f0e6fa93 100644
--- a/src/rt/rust_crate_reader.cpp
+++ b/src/rt/rust_crate_reader.cpp
@@ -118,7 +118,7 @@ rust_crate_reader::abbrev_reader::abbrev_reader
abbrevs(abbrev_mem.dom)
{
rust_dom *dom = mem.dom;
- while (is_ok()) {
+ while (is_ok() && !at_end()) {
// dom->log(rust_log::DWARF, "reading new abbrev at 0x%" PRIxPTR,
// tell_off());