summaryrefslogtreecommitdiff
path: root/libdexfile/external/dex_file_ext.cc
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2023-12-05 13:27:23 +0000
committer David Srbecky <dsrbecky@google.com> 2023-12-05 16:55:57 +0000
commit9322eb5592a33ab48f13581a01e8676fea87c082 (patch)
treee7f67cf6ae59ca407d20ad19ded9d56abaf62876 /libdexfile/external/dex_file_ext.cc
parentfaa7ecb34f493326b6ec0c1498d8bd5e23a665c3 (diff)
Fix CtsSimpleperfTestCases for container dex
ADexFile_create should use the overload that explicitly allows loading just one dex file from container. Rename this overload to make it clearer in the callers. Test: atest CtsSimpleperfTestCases Change-Id: I998b5e68c6966212e49cd32bd812c8062533a98e
Diffstat (limited to 'libdexfile/external/dex_file_ext.cc')
-rw-r--r--libdexfile/external/dex_file_ext.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/libdexfile/external/dex_file_ext.cc b/libdexfile/external/dex_file_ext.cc
index 5a6dc219cb..3a511ea1c9 100644
--- a/libdexfile/external/dex_file_ext.cc
+++ b/libdexfile/external/dex_file_ext.cc
@@ -192,11 +192,12 @@ ADexFile_Error ADexFile_create(const void* _Nonnull address,
std::string loc_str(location);
std::string error_msg;
art::DexFileLoader loader(static_cast<const uint8_t*>(address), full_size, loc_str);
- std::unique_ptr<const art::DexFile> dex_file = loader.Open(header->checksum_,
- /*oat_dex_file=*/nullptr,
- /*verify=*/false,
- /*verify_checksum=*/false,
- &error_msg);
+ std::unique_ptr<const art::DexFile> dex_file = loader.OpenOne(/*header_offset=*/0,
+ header->checksum_,
+ /*oat_dex_file=*/nullptr,
+ /*verify=*/false,
+ /*verify_checksum=*/false,
+ &error_msg);
if (dex_file == nullptr) {
LOG(ERROR) << "Can not open dex file " << loc_str << ": " << error_msg;
return ADEXFILE_ERROR_INVALID_DEX;