diff options
| author | 2017-11-02 15:28:09 -0700 | |
|---|---|---|
| committer | 2017-11-02 19:52:56 -0700 | |
| commit | ee29a07e1eb8be3dafc6ac62ef49f2d147d405cc (patch) | |
| tree | 11c221884f5a66597e5a6fa1359f39dac7bef008 /runtime | |
| parent | ab13432123bc22c997f9dbb12596f05ce782561a (diff) | |
ART: Fix OOME case in proxy dispatch
Even just creating the java.lang.reflect.Method to pass to the
handler may throw an exception.
Add coverage to run-test 044.
Bug: 68817306
Test: m test-art-host
Change-Id: Iacf8fd679b9e8a81ff7bf7d5f6227e875ab10518
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/entrypoints/quick/quick_trampoline_entrypoints.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc index 4d7c2a1acb..a4a8c349a3 100644 --- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc @@ -961,9 +961,13 @@ extern "C" uint64_t artQuickProxyInvokeHandler( self->EndAssertNoThreadSuspension(old_cause); DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), kRuntimePointerSize); DCHECK(!Runtime::Current()->IsActiveTransaction()); - jobject interface_method_jobj = soa.AddLocalReference<jobject>( - mirror::Method::CreateFromArtMethod<kRuntimePointerSize, false>(soa.Self(), - interface_method)); + ObjPtr<mirror::Method> interface_reflect_method = + mirror::Method::CreateFromArtMethod<kRuntimePointerSize, false>(soa.Self(), interface_method); + if (interface_reflect_method == nullptr) { + soa.Self()->AssertPendingOOMException(); + return 0; + } + jobject interface_method_jobj = soa.AddLocalReference<jobject>(interface_reflect_method); // All naked Object*s should now be in jobjects, so its safe to go into the main invoke code // that performs allocations. |