ART: Use reinterpret_cast{32,64}<> when appropriate.
And fix UnstartedRuntime checking for null arguments in all
functions where we now use reinterpret_cast32<>.
This is a follow-up to
https://android-review.googlesource.com/783607 .
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Test: m test-art-target-gtest
Test: testrunner.py --target --optimizing
Bug: 117427174
Change-Id: I58f8ad59f70e3fbb1d06aef419cd26555706fa65
diff --git a/runtime/class_loader_context.cc b/runtime/class_loader_context.cc
index 832f1d7..4da0091 100644
--- a/runtime/class_loader_context.cc
+++ b/runtime/class_loader_context.cc
@@ -19,6 +19,7 @@
#include <android-base/parseint.h>
#include "art_field-inl.h"
+#include "base/casts.h"
#include "base/dchecked_vector.h"
#include "base/stl_util.h"
#include "class_linker.h"
@@ -474,8 +475,8 @@
int32_t long_array_size = long_array->GetLength();
// Index 0 from the long array stores the oat file. The dex files start at index 1.
for (int32_t j = 1; j < long_array_size; ++j) {
- const DexFile* cp_dex_file = reinterpret_cast<const DexFile*>(static_cast<uintptr_t>(
- long_array->GetWithoutChecks(j)));
+ const DexFile* cp_dex_file =
+ reinterpret_cast64<const DexFile*>(long_array->GetWithoutChecks(j));
if (cp_dex_file != nullptr && cp_dex_file->NumClassDefs() > 0) {
// TODO(calin): It's unclear why the dex files with no classes are skipped here and when
// cp_dex_file can be null.