summaryrefslogtreecommitdiffstats
path: root/openjdkjvmti/fixed_up_dex_file.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2018-02-07 13:47:17 -0800
committerMathieu Chartier <mathieuc@google.com>2018-02-07 14:56:50 -0800
commit05f90d133d288b524eaa9deacdc56e7d29ea9f99 (patch)
tree89153d3bccc0aba04423f5712fee09e768d5aa2c /openjdkjvmti/fixed_up_dex_file.cc
parent0efe3243d4f1878e8220ff8bc469beee9ac90518 (diff)
downloadart-05f90d133d288b524eaa9deacdc56e7d29ea9f99.tar.gz
art-05f90d133d288b524eaa9deacdc56e7d29ea9f99.tar.bz2
art-05f90d133d288b524eaa9deacdc56e7d29ea9f99.zip
Avoid generating cdex for dex files with duplicate methods
For the cases where two different method have the same code item or debug info, avoid generating cdex and write the input dex into the oat file isntead. Test: test-art-host-gtest Bug: 72997076 Bug: 72100771 Bug: 72100668 Bug: 63756964 Change-Id: I5dfe2b47b2c908921c8421367536c2d950186ac6
Diffstat (limited to 'openjdkjvmti/fixed_up_dex_file.cc')
-rw-r--r--openjdkjvmti/fixed_up_dex_file.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/openjdkjvmti/fixed_up_dex_file.cc b/openjdkjvmti/fixed_up_dex_file.cc
index e9522b3984..427d87eedf 100644
--- a/openjdkjvmti/fixed_up_dex_file.cc
+++ b/openjdkjvmti/fixed_up_dex_file.cc
@@ -104,10 +104,13 @@ std::unique_ptr<FixedUpDexFile> FixedUpDexFile::Create(const art::DexFile& origi
/*out_file*/ nullptr,
/*header*/ nullptr);
std::unique_ptr<art::DexContainer> dex_container;
- dex_layout.ProcessDexFile(original.GetLocation().c_str(),
- &original,
- 0,
- &dex_container);
+ bool result = dex_layout.ProcessDexFile(
+ original.GetLocation().c_str(),
+ &original,
+ 0,
+ &dex_container,
+ &error);
+ CHECK(result) << "Failed to generate dex file " << error;
art::DexContainer::Section* main_section = dex_container->GetMainSection();
CHECK_EQ(dex_container->GetDataSection()->Size(), 0u);
data.insert(data.end(), main_section->Begin(), main_section->End());