Return an invalid StackMap when one cannot be found.
This avoids aborting when handling a crash.
Change-Id: Ie5b5d48061fa9258b349b0284f7b00c5855d9fbd
diff --git a/runtime/stack_map.h b/runtime/stack_map.h
index f07fb74..f710460 100644
--- a/runtime/stack_map.h
+++ b/runtime/stack_map.h
@@ -641,6 +641,9 @@
class StackMap {
public:
explicit StackMap(MemoryRegion region) : region_(region) {}
+ StackMap() {}
+
+ bool IsValid() const { return region_.pointer() != nullptr; }
uint32_t GetDexPc(const CodeInfo& info) const;
@@ -1029,8 +1032,7 @@
return stack_map;
}
}
- LOG(FATAL) << "Unreachable";
- UNREACHABLE();
+ return StackMap();
}
StackMap GetStackMapForNativePcOffset(uint32_t native_pc_offset) const {
@@ -1041,8 +1043,7 @@
return stack_map;
}
}
- LOG(FATAL) << "Unreachable";
- UNREACHABLE();
+ return StackMap();
}
void Dump(std::ostream& os, uint16_t number_of_dex_registers) const;