Fix stale root error in verifier
There was a stale root error caused by the static roots from
the reg types. These were visitied if there was an active verifier
in the method_verifiers_ but this is not always the case when a GC
is run. The fix is to always visit the static method verifier roots.
This only showed up as a bug without an image since these roots
were primitive classes and always in the image, and therefore
didn't ever need to be updated due to moving GC.
Bug: 17262039
Change-Id: I592f2770570de97b431671cfbd409f63697892f1
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 4e2bfa0..17de883 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1145,6 +1145,7 @@
callee_save_methods_[i].VisitRoot(callback, arg, 0, kRootVMInternal);
}
}
+ verifier::MethodVerifier::VisitStaticRoots(callback, arg);
{
MutexLock mu(Thread::Current(), method_verifier_lock_);
for (verifier::MethodVerifier* verifier : method_verifiers_) {