From 519fd543625da68ef93f0cd5539c949e5e74e04e Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 2 Jun 2015 09:56:04 -0700 Subject: [PATCH] Update IMT for stale miranda methods Fixes occasional crash in dex2oat. Bug: 19264997 Change-Id: Icb1a323d8c44fa40309486e17aec56d2c2588e67 --- runtime/class_linker.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index fb2debd63..84d10008e 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -5018,6 +5018,13 @@ bool ClassLinker::LinkInterfaceMethods(Thread* self, Handle klass } } } + // 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(); -- 2.11.0