Use kPointerSize when cross-compiling.
ArtMethod::At should be passed the kPointerSize for cross-compilation.
Unfortunately, we don't have a good setup for testing cross-compilation,
so rely on APK scanner for testing.
Test: APK scanner
Test: manually compiling an APK that used to crash.
Bug: 264002996
Bug: 263386862
Bug: 230684246
Change-Id: I85cee2ef594a4c6fd107b32ee5a10d02b4edfa77
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index a2f4513..d5efb68 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -7903,7 +7903,8 @@
LengthPrefixedArray<ArtMethod>* const new_methods = klass->GetMethodsPtr();
if (new_methods != nullptr) {
DCHECK_NE(new_methods->size(), 0u);
- imt_methods_begin = reinterpret_cast<uintptr_t>(&new_methods->At(0));
+ imt_methods_begin =
+ reinterpret_cast<uintptr_t>(&new_methods->At(0, kMethodSize, kMethodAlignment));
imt_methods_size = new_methods->size() * kMethodSize;
}
}