Cast method pointer to uintptr_t before uint64_t
Previously we were casting a pointer to uint64_t. This sign extends.
This change fixes 64 bit app image crashes on angler.
Bug: 22858531
Change-Id: I03e973a0c5a1d74db7e8db0f13f5b1825d8d8ab5
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h
index 75a3f1a..d5783c0 100644
--- a/runtime/mirror/class-inl.h
+++ b/runtime/mirror/class-inl.h
@@ -157,7 +157,7 @@
inline LengthPrefixedArray<ArtMethod>* Class::GetMethodsPtr() {
return reinterpret_cast<LengthPrefixedArray<ArtMethod>*>(
- GetField64(OFFSET_OF_OBJECT_MEMBER(Class, methods_)));
+ static_cast<uintptr_t>(GetField64(OFFSET_OF_OBJECT_MEMBER(Class, methods_))));
}
template<VerifyObjectFlags kVerifyFlags>
@@ -208,7 +208,7 @@
inline void Class::SetMethodsPtrInternal(LengthPrefixedArray<ArtMethod>* new_methods) {
SetField64<false>(OFFSET_OF_OBJECT_MEMBER(Class, methods_),
- reinterpret_cast<uint64_t>(new_methods));
+ static_cast<uint64_t>(reinterpret_cast<uintptr_t>(new_methods)));
}
template<VerifyObjectFlags kVerifyFlags>