summaryrefslogtreecommitdiff
path: root/runtime/art_method.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2022-07-06 10:01:58 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2022-07-07 16:58:21 +0000
commitd88c1499efe2f718f3cc1f45a3dc178471b22ce6 (patch)
treed28e20d9a4f87d2c1fc9a867b111cdc818ff250a /runtime/art_method.h
parent4a21275dfb1bc58ede8141cbfd103ad46c3fcf2d (diff)
Fix one edge case at method linking to throw at runtime.
If we could not find a public implementation for a public method, throw an IllegalAccessError at runtime, when the method is actually called, instead of when the class is being created. Test: 840-resolution Test: 182-method-linking Change-Id: I741c7d0f6fc3b90a5d1614e1a9b76985a2eb32e2
Diffstat (limited to 'runtime/art_method.h')
-rw-r--r--runtime/art_method.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/art_method.h b/runtime/art_method.h
index d8bd3803fc..072dea2c4d 100644
--- a/runtime/art_method.h
+++ b/runtime/art_method.h
@@ -422,8 +422,10 @@ class ArtMethod final {
bool CheckIncompatibleClassChange(InvokeType type) REQUIRES_SHARED(Locks::mutator_lock_);
// Throws the error that would result from trying to invoke this method (i.e.
- // IncompatibleClassChangeError or AbstractMethodError). Only call if !IsInvokable();
- void ThrowInvocationTimeError() REQUIRES_SHARED(Locks::mutator_lock_);
+ // IncompatibleClassChangeError, AbstractMethodError, or IllegalAccessError).
+ // Only call if !IsInvokable();
+ void ThrowInvocationTimeError(ObjPtr<mirror::Object> receiver)
+ REQUIRES_SHARED(Locks::mutator_lock_);
uint16_t GetMethodIndex() REQUIRES_SHARED(Locks::mutator_lock_);