Fix ReadBarrier misuse when relocating the image.
Specify not to use ReadBarrier when calling to GetSuperClass during
relocation.
Bug: 63691502
Test: test/testrunner/testrunner.py -b --host -t \
test-art-host-run-test-debug-prebuild-optimizing-no-relocate-\
ntrace-gcstress-checkjni-picimage-npictest-ndebuggable-no-jvmti-\
626-const-class-linking64
Change-Id: I9fbfdd4ffa2c7489da2e3c62af4f196ec07e562e
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index b229b6c..3ae382e 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -1012,7 +1012,7 @@
mirror::Class* klass = obj->AsClass<kVerifyNone, kWithoutReadBarrier>();
// Fixup super class before visiting instance fields which require
// information from their super class to calculate offsets.
- mirror::Class* super_class = klass->GetSuperClass();
+ mirror::Class* super_class = klass->GetSuperClass<kVerifyNone, kWithoutReadBarrier>();
if (super_class != nullptr) {
mirror::Class* new_super_class = down_cast<mirror::Class*>(ForwardObject(super_class));
if (new_super_class != super_class && IsInAppImage(new_super_class)) {