From 78baed5ec51a6e2d113e8b29aafa5c6203b46845 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 11 Oct 2018 10:44:58 +0100 Subject: 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 --- runtime/class_loader_context.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/class_loader_context.cc') 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 #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 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(static_cast( - long_array->GetWithoutChecks(j))); + const DexFile* cp_dex_file = + reinterpret_cast64(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. -- cgit v1.2.3-59-g8ed1b