diff --git a/plugins/ets/runtime/ets_language_context.h b/plugins/ets/runtime/ets_language_context.h index 40129201913ba53a7a2861cd9be6ab5c7eb620f4..2909ef6af659760f5249db9d856dc1a64dc3aaf9 100644 --- a/plugins/ets/runtime/ets_language_context.h +++ b/plugins/ets/runtime/ets_language_context.h @@ -100,7 +100,7 @@ public: const uint8_t *GetStackOverflowErrorClassDescriptor() const override { - return utf::CStringAsMutf8("Lstd/core/StackOverflowException;"); + return utf::CStringAsMutf8("Lstd/core/StackOverflowError;"); } const uint8_t *GetArrayIndexOutOfBoundsExceptionClassDescriptor() const override diff --git a/plugins/ets/runtime/ets_vm.cpp b/plugins/ets/runtime/ets_vm.cpp index 2384a717d23d6b99000f7a75d292958a2b8b0e63..18796bb8b206ce057317f7a99215afeb4ec7c40f 100644 --- a/plugins/ets/runtime/ets_vm.cpp +++ b/plugins/ets/runtime/ets_vm.cpp @@ -214,7 +214,7 @@ bool PandaEtsVM::Initialize() bool PandaEtsVM::InitializeFinish() { - // Preinitialize StackOverflowException, so we don't need to do this when stack overflow occurred + // Preinitialize StackOverflowError, so we don't need to do this when stack overflow occurred auto ctx = ets::utils::GetLanguageContext(); auto boot_context = ets::utils::GetClassLinkerExtension()->GetBootContext(); diff --git a/plugins/ets/stdlib/std/core/StdExceptions.ets b/plugins/ets/stdlib/std/core/StdExceptions.ets index ebe5492ec56d7a1d40edae47c80bc577eace4bb7..a69eb3e0211af2dc119a38c977e10697d433e6ae 100644 --- a/plugins/ets/stdlib/std/core/StdExceptions.ets +++ b/plugins/ets/stdlib/std/core/StdExceptions.ets @@ -255,6 +255,15 @@ class NoSuchMethodError extends Exception { } } +/** + * @class Represents exception that is thrown when the available memory is not sufficient to create the activation frame + */ +class StackOverflowError extends Exception { + constructor() { + super(); + } +} + /** * @class Represents exception that is thrown when attempting to store an object of different type in array of type-erased objects */ diff --git a/plugins/ets/tests/integrational/mock_stdlib.pa b/plugins/ets/tests/integrational/mock_stdlib.pa index 44b19a41aef26ef8fb0e1acc97a964f0ac2d6850..c64f2475cb91ce50d38e24e6ddb86de52cf863bf 100644 --- a/plugins/ets/tests/integrational/mock_stdlib.pa +++ b/plugins/ets/tests/integrational/mock_stdlib.pa @@ -15,6 +15,7 @@ .record std.core.String .record std.core.Object +.record std.core.StackOverflowError .record std.core.OutOfMemoryError { std.core.String message