diff options
author | Mathieu Chartier <mathieuc@google.com> | 2016-01-26 20:11:06 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2016-01-26 20:17:11 -0800 |
commit | f4b3dbad413023795b92a842aad1c3f2fe4a57e9 (patch) | |
tree | f2d440185d04789f81550db6cbe7e4d7e4e97519 /runtime/mirror/class-inl.h | |
parent | 902838d865eaed9fa4df6414c706e5f6787d02ea (diff) | |
download | art-f4b3dbad413023795b92a842aad1c3f2fe4a57e9.tar.gz art-f4b3dbad413023795b92a842aad1c3f2fe4a57e9.tar.bz2 art-f4b3dbad413023795b92a842aad1c3f2fe4a57e9.zip |
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
Diffstat (limited to 'runtime/mirror/class-inl.h')
-rw-r--r-- | runtime/mirror/class-inl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h index 75a3f1aa05..d5783c04b5 100644 --- a/runtime/mirror/class-inl.h +++ b/runtime/mirror/class-inl.h @@ -157,7 +157,7 @@ inline ArraySlice<ArtMethod> Class::GetCopiedMethodsSliceUnchecked(size_t pointe 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::SetMethodsPtrUnchecked(LengthPrefixedArray<ArtMethod>* new_me 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> |