Do not crash for broken stored VerifierDeps.
Propagate the error to the callers. Also avoid filling in
unused data structures when we want only verified classes.
Test: aosp_taimen-userdebug boots.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 151220989
Change-Id: I3ad0d725251037006128c1f631e6bd6dcec3a592
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 8d33970..3acea42 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -564,7 +564,11 @@
}
dex_files.push_back(dex_file);
}
- verifier::VerifierDeps deps(dex_files, oat_file_.GetVdexFile()->GetVerifierDepsData());
+ verifier::VerifierDeps deps(dex_files, /*output_only=*/ false);
+ if (!deps.ParseStoredData(dex_files, oat_file_.GetVdexFile()->GetVerifierDepsData())) {
+ os << "Error parsing verifier dependencies." << std::endl;
+ return false;
+ }
deps.Dump(&vios);
} else {
os << "UNRECOGNIZED vdex file, magic "