Verify that the elf matches the expected arch.
To avoid a case where a malicious app might try and trick the system to
create an elf and register object that mismatches, always verify that they
are the same arch.
Test: Ran unit tests.
Change-Id: I66978e9e02f8e4f396856912e7019528ead4838e
diff --git a/libunwindstack/JitDebug.cpp b/libunwindstack/JitDebug.cpp
index d6af49e..20bc4b9 100644
--- a/libunwindstack/JitDebug.cpp
+++ b/libunwindstack/JitDebug.cpp
@@ -141,8 +141,8 @@
return code.next;
}
-void JitDebug::SetArch(ArchEnum arch) {
- switch (arch) {
+void JitDebug::ProcessArch() {
+ switch (arch()) {
case ARCH_X86:
read_descriptor_func_ = &JitDebug::ReadDescriptor32;
read_entry_func_ = &JitDebug::ReadEntry32Pack;