diff options
author | 2018-10-11 10:44:58 +0100 | |
---|---|---|
committer | 2018-10-12 17:53:50 +0100 | |
commit | 78baed5ec51a6e2d113e8b29aafa5c6203b46845 (patch) | |
tree | 57ca544020f309e3529e33300ad4867ca4579c1e /runtime/class_loader_context.cc | |
parent | a48eb7e0690187618d2824a7d9b5601e7f5cdf80 (diff) |
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
Diffstat (limited to 'runtime/class_loader_context.cc')
-rw-r--r-- | runtime/class_loader_context.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/class_loader_context.cc b/runtime/class_loader_context.cc index 832f1d74ff..4da0091884 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 @@ static bool CollectDexFilesFromJavaDexFile(ObjPtr<mirror::Object> java_dex_file, 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. |