Handle allocation failure in AddPreResolvedStringsArray
Might fail on 32 bits if the address space is fragmented.
Regression test is infeasible to add.
Bug: 134652205
Test: test-art-host
Change-Id: I8a254a27275be4e0ff39fdb72715771f4f77cf36
diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h
index e399a8c..b41443e 100644
--- a/runtime/mirror/dex_cache.h
+++ b/runtime/mirror/dex_cache.h
@@ -473,7 +473,8 @@
uint32_t MethodSlotIndex(uint32_t method_idx) REQUIRES_SHARED(Locks::mutator_lock_);
uint32_t MethodTypeSlotIndex(dex::ProtoIndex proto_idx) REQUIRES_SHARED(Locks::mutator_lock_);
- void AddPreResolvedStringsArray() REQUIRES_SHARED(Locks::mutator_lock_);
+ // Returns true if we succeeded in adding the pre-resolved string array.
+ bool AddPreResolvedStringsArray() REQUIRES_SHARED(Locks::mutator_lock_);
private:
void Init(const DexFile* dex_file,