From 880827b702b6d5f4c515f09e1672b7d2c5ad23ee 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 112e485bfe..a2adaaa3af 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 8a00323dde..2ba9dfcb2a 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 967b7222fe..9ae8c5afd1 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(); -- Gitee