diff options
author | 2024-10-22 16:15:54 +0100 | |
---|---|---|
committer | 2024-10-23 11:10:38 +0000 | |
commit | 0cdb0fedbf1eae14d56178eda1e800d133a76bea (patch) | |
tree | ae21c13edecc1b9cd3f4f8245a598816bfde2daf /runtime/method_handles.cc | |
parent | 398bedca50a44d26edc84e24a1c1b587cefaf8de (diff) |
x86-64: handle invoke-direct in invokeExact intrinsic.
Also fix NPE not being thrown in the interpreter when receiver is
null in invoke-direct MethodHandle.
Bug: 297147201
Test: ./art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: I30d369316b56713dc7428d264fcff98954c63d37
Diffstat (limited to 'runtime/method_handles.cc')
-rw-r--r-- | runtime/method_handles.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/method_handles.cc b/runtime/method_handles.cc index a91348ae63..741ec0d84d 100644 --- a/runtime/method_handles.cc +++ b/runtime/method_handles.cc @@ -466,6 +466,11 @@ ArtMethod* RefineTargetMethod(Thread* self, // String constructors are replaced with static StringFactory methods when a MethodHandle // object is created. DCHECK(!target_method->IsStringConstructor()); + ObjPtr<mirror::Object> receiver(shadow_frame.GetVRegReference(receiver_reg)); + if (receiver == nullptr) { + ThrowNullPointerException("null receiver"); + return nullptr; + } } else if (handle_kind == mirror::MethodHandle::Kind::kInvokeSuper) { // Note that we're not dynamically dispatching on the type of the receiver // here. We use the static type of the "receiver" object that we've |