summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-03-10 04:15:03 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-03-10 04:15:03 +0000
commit96c4715d5ce952999f066ec74ecc8609a0856733 (patch)
tree06464dbf59ceeb5aacbaaaebcf7b01a20ecd13d7
parentfe102795cf1526e8b48c564a91d81ec218f3387a (diff)
parentb756815e581e2bcc3db7ee0cb3ae6c031fb22ae8 (diff)
Merge "Add dex file verification check for dexlayout output file."
-rw-r--r--dexlayout/dexlayout.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/dexlayout/dexlayout.cc b/dexlayout/dexlayout.cc
index 4aa8b82ec7..3ce7e1ad5b 100644
--- a/dexlayout/dexlayout.cc
+++ b/dexlayout/dexlayout.cc
@@ -34,6 +34,7 @@
#include "dex_ir_builder.h"
#include "dex_file-inl.h"
+#include "dex_file_verifier.h"
#include "dex_instruction-inl.h"
#include "dex_visualize.h"
#include "dex_writer.h"
@@ -1756,6 +1757,16 @@ void DexLayout::ProcessDexFile(const char* file_name,
LayoutOutputFile(dex_file);
}
OutputDexFile(dex_file->GetLocation());
+ // Verify the output dex file is ok on debug builds.
+ if (kIsDebugBuild) {
+ std::string error_msg;
+ DCHECK(DexFileVerifier::Verify(dex_file,
+ dex_file->Begin(),
+ dex_file->Size(),
+ dex_file->GetLocation().c_str(),
+ false,
+ &error_msg));
+ }
}
}