Extra debug info, make dump stack slightly more tolerant of bad input.
Change-Id: I33b0ba5158ff60dcdb94fa8d831c193b4ea124ed
diff --git a/src/dex_verifier.h b/src/dex_verifier.h
index a703cbc..3a7e3d2 100644
--- a/src/dex_verifier.h
+++ b/src/dex_verifier.h
@@ -1225,7 +1225,7 @@
public:
PcToReferenceMap(Method* m) {
data_ = down_cast<ByteArray*>(m->GetGcMap());
- CHECK(data_ != NULL);
+ CHECK(data_ != NULL) << PrettyMethod(m);
// Check the size of the table agrees with the number of entries
size_t data_size = data_->GetLength() - 4;
DCHECK_EQ(EntryWidth() * NumEntries(), data_size);
diff --git a/src/thread.cc b/src/thread.cc
index e3596d3..b8df84f 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -510,8 +510,12 @@
Method* m = frame.GetMethod();
Class* c = m->GetDeclaringClass();
ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
- const DexFile& dex_file = class_linker->FindDexFile(c->GetDexCache());
- int line_number = dex_file.GetLineNumFromPC(m, m->ToDexPC(pc));
+ const DexCache* dex_cache = c->GetDexCache();
+ int line_number = -1;
+ if (dex_cache != NULL) { // be tolerant of bad input
+ const DexFile& dex_file = class_linker->FindDexFile(dex_cache);
+ line_number = dex_file.GetLineNumFromPC(m, m->ToDexPC(pc));
+ }
if (line_number == last_line_number && last_method == m) {
repetition_count++;
} else {