From: Mathieu Chartier Date: Wed, 3 Sep 2014 18:21:08 +0000 (-0700) Subject: Add exception check to AllocateInternalWithGc X-Git-Tag: android-x86-6.0-r1~145^2~2^2~236^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=98d43cb0da3c34d1888d1e31d953c2940fd0f897;p=android-x86%2Fart.git Add exception check to AllocateInternalWithGc Trying to figure out if the pending exception comes before or during AllocateInternalWithGc. Bug: 17164348 Change-Id: Id46d82bfc0f84d16e5ffdafe41658aee4cc2c702 --- diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index ce914e543..7e7b8593c 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -1225,6 +1225,8 @@ mirror::Object* Heap::AllocateInternalWithGc(Thread* self, AllocatorType allocat size_t* usable_size, mirror::Class** klass) { bool was_default_allocator = allocator == GetCurrentAllocator(); + // Make sure there is no pending exception since we may need to throw an OOME. + self->AssertNoPendingException(); DCHECK(klass != nullptr); StackHandleScope<1> hs(self); HandleWrapper h(hs.NewHandleWrapper(klass));