Fix pointer conversion error in SetElementPtrSize
SetElementPtrSize used to cast from pointer to uint64_t which
could sign extend with 32 bit dex2oat for 64 bit app image.
Also removed C style casts and added more logging.
Bug: 22858531
(cherry picked from commit d22886357d4c53f74ca298faa7ad2555794e17e0)
Change-Id: I479124328fbc497cfcae20c43b4b55827e446527
diff --git a/runtime/mirror/array.h b/runtime/mirror/array.h
index 50d77eb..2bd6c5b 100644
--- a/runtime/mirror/array.h
+++ b/runtime/mirror/array.h
@@ -187,8 +187,11 @@
T GetElementPtrSize(uint32_t idx, size_t ptr_size)
SHARED_REQUIRES(Locks::mutator_lock_);
+ template<bool kTransactionActive = false, bool kUnchecked = false>
+ void SetElementPtrSize(uint32_t idx, uint64_t element, size_t ptr_size)
+ SHARED_REQUIRES(Locks::mutator_lock_);
template<bool kTransactionActive = false, bool kUnchecked = false, typename T>
- void SetElementPtrSize(uint32_t idx, T element, size_t ptr_size)
+ void SetElementPtrSize(uint32_t idx, T* element, size_t ptr_size)
SHARED_REQUIRES(Locks::mutator_lock_);
// Fixup the pointers in the dest arrays by passing our pointers through the visitor. Only copies