summaryrefslogtreecommitdiff
path: root/patchoat/patchoat.h
diff options
context:
space:
mode:
author Jeff Hao <jeffhao@google.com> 2016-01-04 17:38:06 -0800
committer Jeff Hao <jeffhao@google.com> 2016-01-04 19:08:51 -0800
commit0d2af30df4000101b7c4b4e6b6350460a141edc8 (patch)
treea2599d57c060914fb10c9ba06f96ccd8a17a42e0 /patchoat/patchoat.h
parent376a6f3dbae7b71a6fc2c339ec416d3407277308 (diff)
Fix multi-image TODOs in patchoat.
- Reinstated checks that were still valid (one check was removed). - Removed unused path that patches only images. Bug: 26317072 (cherry-picked from commit e271fe1e2797205c57c052212c32139234f781ea) Change-Id: I0e140cb110abbfa469c097c805657ecfdc8552d6
Diffstat (limited to 'patchoat/patchoat.h')
-rw-r--r--patchoat/patchoat.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/patchoat/patchoat.h b/patchoat/patchoat.h
index cb0d14b2c2..ceddc343be 100644
--- a/patchoat/patchoat.h
+++ b/patchoat/patchoat.h
@@ -133,12 +133,11 @@ class PatchOat {
if (obj == nullptr) {
return nullptr;
}
- // TODO: Fix these checks for multi-image. Some may still be valid. b/26317072
- // DCHECK_GT(reinterpret_cast<uintptr_t>(obj), reinterpret_cast<uintptr_t>(heap_->Begin()));
- // DCHECK_LT(reinterpret_cast<uintptr_t>(obj), reinterpret_cast<uintptr_t>(heap_->End()));
+ DCHECK_GT(reinterpret_cast<uintptr_t>(obj), reinterpret_cast<uintptr_t>(heap_->Begin()));
+ DCHECK_LT(reinterpret_cast<uintptr_t>(obj), reinterpret_cast<uintptr_t>(heap_->End()));
uintptr_t heap_off =
reinterpret_cast<uintptr_t>(obj) - reinterpret_cast<uintptr_t>(heap_->Begin());
- // DCHECK_LT(heap_off, image_->Size());
+ DCHECK_LT(heap_off, image_->Size());
return reinterpret_cast<T*>(image_->Begin() + heap_off);
}