Return error message if IndirectReferenceTable construction fails.
Previously if there was an error when constructing the
IndirectReferenceTable, the error message was lost. Now expose and
include the error message when throwing an exception related to
failures to construct the IndirectReferenceTable.
The error message is propagated through JVMEnvExt, JavaVMExt, and
Runtime::Init as well.
Bug: 32013594
Test: Added new 151-OpenFileLimit runtest.
Test: m test-art-host, m test-art-target
Change-Id: I3692f6928c9570358571bce634569d6f14cdeb05
diff --git a/runtime/indirect_reference_table_test.cc b/runtime/indirect_reference_table_test.cc
index 7b28f0b..d7026de 100644
--- a/runtime/indirect_reference_table_test.cc
+++ b/runtime/indirect_reference_table_test.cc
@@ -49,7 +49,9 @@
ScopedObjectAccess soa(Thread::Current());
static const size_t kTableMax = 20;
- IndirectReferenceTable irt(kTableMax, kGlobal);
+ std::string error_msg;
+ IndirectReferenceTable irt(kTableMax, kGlobal, &error_msg);
+ ASSERT_TRUE(irt.IsValid()) << error_msg;
mirror::Class* c = class_linker_->FindSystemClass(soa.Self(), "Ljava/lang/Object;");
StackHandleScope<4> hs(soa.Self());