Update IMT for stale miranda methods
Fixes occasional crash in dex2oat.
Bug: 19264997
Change-Id: Icb1a323d8c44fa40309486e17aec56d2c2588e67
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index fb2debd..84d1000 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -5018,6 +5018,13 @@
}
}
}
+ // Fix up IMT in case it has any miranda methods in it.
+ for (size_t i = 0; i < mirror::Class::kImtSize; ++i) {
+ auto it = move_table.find(out_imt[i]);
+ if (it != move_table.end()) {
+ out_imt[i] = it->second;
+ }
+ }
// Check that there are no stale methods are in the dex cache array.
if (kIsDebugBuild) {
auto* resolved_methods = klass->GetDexCache()->GetResolvedMethods();