Add missing EndAssertNoThreadSuspension
Bug: 21872507
Change-Id: I20f9920e4a12511ce498c252bca955d82a4f4102
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 91812e7..31749bf 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -4901,6 +4901,9 @@
if (interface_name_comparator.HasSameNameAndSignature(
vtable_method_for_name_comparison)) {
if (!vtable_method->IsAbstract() && !vtable_method->IsPublic()) {
+ // Must do EndAssertNoThreadSuspension before throw since the throw can cause
+ // allocations.
+ self->EndAssertNoThreadSuspension(old_cause);
ThrowIllegalAccessError(klass.Get(),
"Method '%s' implementing interface method '%s' is not public",
PrettyMethod(vtable_method).c_str(), PrettyMethod(interface_method).c_str());