Fix a libartd.so boot crash in Heap::AllocObjectWithAllocator()
Bug: 11806947
Change-Id: I826875f23ee2233d4128e852ff6fe7e26ced378f
diff --git a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
index b71b880..9155088 100644
--- a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
@@ -57,14 +57,22 @@
mirror::ArtMethod** sp) \
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { \
FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); \
- return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, false, allocator_type); \
+ if (!instrumented_bool) { \
+ return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, false, allocator_type); \
+ } else { \
+ return CheckAndAllocArrayFromCodeInstrumented(type_idx, method, component_count, self, false, allocator_type); \
+ } \
} \
extern "C" mirror::Array* artCheckAndAllocArrayFromCodeWithAccessCheck##suffix##suffix2( \
uint32_t type_idx, mirror::ArtMethod* method, int32_t component_count, Thread* self, \
mirror::ArtMethod** sp) \
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { \
FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); \
- return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, true, allocator_type); \
+ if (!instrumented_bool) { \
+ return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, true, allocator_type); \
+ } else { \
+ return CheckAndAllocArrayFromCodeInstrumented(type_idx, method, component_count, self, true, allocator_type); \
+ } \
}
#define GENERATE_ENTRYPOINTS_FOR_ALLOCATOR(suffix, allocator_type) \