summaryrefslogtreecommitdiffstats
path: root/runtime/oat.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/oat.cc')
-rw-r--r--runtime/oat.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/oat.cc b/runtime/oat.cc
index 80231f3890..aab0e81047 100644
--- a/runtime/oat.cc
+++ b/runtime/oat.cc
@@ -182,8 +182,12 @@ void OatHeader::UpdateChecksumWithHeaderData() {
void OatHeader::UpdateChecksum(const void* data, size_t length) {
DCHECK(IsValid());
- const uint8_t* bytes = reinterpret_cast<const uint8_t*>(data);
- adler32_checksum_ = adler32(adler32_checksum_, bytes, length);
+ if (data != nullptr) {
+ const uint8_t* bytes = reinterpret_cast<const uint8_t*>(data);
+ adler32_checksum_ = adler32(adler32_checksum_, bytes, length);
+ } else {
+ DCHECK_EQ(0U, length);
+ }
}
InstructionSet OatHeader::GetInstructionSet() const {