diff options
author | 2017-08-09 20:13:18 -0700 | |
---|---|---|
committer | 2017-08-09 20:13:38 -0700 | |
commit | ad8ebb38059b9fe47fde8b1390113eabba2ac888 (patch) | |
tree | 092c7500442ed32121424bfaa980b3b700d90657 /runtime/fault_handler.cc | |
parent | ac50d97b1bf63ff2e0d813774f52499b2da78f6b (diff) |
Use HeapReference for SafeGetClass
Make sure to use heap refernece here so the value read isn't bogus
for heap poisoning. Fixes heap poisoning tests that were broken for
implicit null checks.
Bug: 31023171
Test: test/testrunner/testrunner.py --interpreter --optimizing -j20 --host --verbose
Change-Id: Ia67cdb304be205773d781251235f8b0b4bf7c0bd
Diffstat (limited to 'runtime/fault_handler.cc')
-rw-r--r-- | runtime/fault_handler.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/fault_handler.cc b/runtime/fault_handler.cc index f86329947d..7d01af02a3 100644 --- a/runtime/fault_handler.cc +++ b/runtime/fault_handler.cc @@ -79,8 +79,7 @@ static mirror::Class* SafeGetDeclaringClass(ArtMethod* method) static mirror::Class* SafeGetClass(mirror::Object* obj) REQUIRES_SHARED(Locks::mutator_lock_) { char* obj_cls = reinterpret_cast<char*>(obj) + mirror::Object::ClassOffset().SizeValue(); - mirror::CompressedReference<mirror::Class> cls = - mirror::CompressedReference<mirror::Class>::FromMirrorPtr(nullptr); + mirror::HeapReference<mirror::Class> cls; ssize_t rc = SafeCopy(&cls, obj_cls, sizeof(cls)); CHECK_NE(-1, rc); |