From 8502f72d0e5257c1ff9c61e0567146568d39ee6d Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 8 Jun 2016 15:09:08 -0700 Subject: [PATCH] Add a few more pending exception checks Bug: 28371539 Change-Id: Ibd2f7ccf7bd8cf7ef6c24534be1efbcc9b30014a --- runtime/class_linker.cc | 1 + runtime/gc/heap-inl.h | 1 + 2 files changed, 2 insertions(+) diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 15cc6343e..db0e9ac9c 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -4977,6 +4977,7 @@ bool ClassLinker::EnsureInitialized(Thread* self, Handle c, bool DCHECK(c.Get() != nullptr); if (c->IsInitialized()) { EnsureSkipAccessChecksMethods(c); + self->AssertNoPendingException(); return true; } const bool success = InitializeClass(self, c, can_init_fields, can_init_parents); diff --git a/runtime/gc/heap-inl.h b/runtime/gc/heap-inl.h index 6aed61af0..b0ca18e1a 100644 --- a/runtime/gc/heap-inl.h +++ b/runtime/gc/heap-inl.h @@ -49,6 +49,7 @@ inline mirror::Object* Heap::AllocObjectWithAllocator(Thread* self, // done in the runnable state where suspension is expected. CHECK_EQ(self->GetState(), kRunnable); self->AssertThreadSuspensionIsAllowable(); + self->AssertNoPendingException(); } // Need to check that we arent the large object allocator since the large object allocation code // path this function. If we didn't check we would have an infinite loop. -- 2.11.0