From 8983526d59d3b11cd34b188f4e8836ead073620e Mon Sep 17 00:00:00 2001 From: shawn_hu_ls Date: Thu, 17 Feb 2022 19:40:30 +0800 Subject: [PATCH] Fix typo error in exceptions Signed-off-by: shawn_hu_ls --- runtime/core/core_language_context.h | 5 +++++ runtime/exceptions.cpp | 2 +- runtime/include/language_context.h | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/runtime/core/core_language_context.h b/runtime/core/core_language_context.h index 112e485..a2adaaa 100644 --- a/runtime/core/core_language_context.h +++ b/runtime/core/core_language_context.h @@ -141,6 +141,11 @@ public: return utf::CStringAsMutf8("Lpanda/IllegalArgumentException;"); } + const uint8_t *GetIllegalAccessExceptionClassDescriptor() const override + { + return utf::CStringAsMutf8("Lpanda/IllegalAccessException;"); + } + const uint8_t *GetOutOfMemoryErrorClassDescriptor() const override { return utf::CStringAsMutf8("Lpanda/OutOfMemoryError;"); diff --git a/runtime/exceptions.cpp b/runtime/exceptions.cpp index 8a00323..2ba9dfc 100644 --- a/runtime/exceptions.cpp +++ b/runtime/exceptions.cpp @@ -246,7 +246,7 @@ void ThrowIllegalAccessException(const PandaString &msg) auto *thread = ManagedThread::GetCurrent(); auto ctx = GetLanguageContext(thread); - ThrowException(ctx, thread, ctx.GetIllegalArgumentExceptionClassDescriptor(), utf::CStringAsMutf8(msg.c_str())); + ThrowException(ctx, thread, ctx.GetIllegalAccessExceptionClassDescriptor(), utf::CStringAsMutf8(msg.c_str())); } void ThrowOutOfMemoryError(ManagedThread *thread, const PandaString &msg) diff --git a/runtime/include/language_context.h b/runtime/include/language_context.h index 967b722..9ae8c5a 100644 --- a/runtime/include/language_context.h +++ b/runtime/include/language_context.h @@ -92,6 +92,8 @@ public: virtual const uint8_t *GetIllegalArgumentExceptionClassDescriptor() const = 0; + virtual const uint8_t *GetIllegalAccessExceptionClassDescriptor() const = 0; + virtual const uint8_t *GetOutOfMemoryErrorClassDescriptor() const = 0; virtual const uint8_t *GetNoClassDefFoundErrorDescriptor() const = 0; @@ -360,6 +362,11 @@ public: return base_->GetIllegalArgumentExceptionClassDescriptor(); } + const uint8_t *GetIllegalAccessExceptionClassDescriptor() const + { + return base_->GetIllegalAccessExceptionClassDescriptor(); + } + const uint8_t *GetOutOfMemoryErrorClassDescriptor() const { return base_->GetOutOfMemoryErrorClassDescriptor();