From d6eb631419477def4c3ba272563e6474bf970295 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sat, 18 Jul 2020 08:11:03 -0700 Subject: [PATCH] Added __STACKOVERFLOW test method --- IDEHelper/Compiler/BfModule.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index a3bdce75..1e3cda91 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -19551,6 +19551,13 @@ void BfModule::CheckHotMethod(BfMethodInstance* methodInstance, const StringImpl } } +static void StackOverflow() +{ + int i = 0; + if (i == 0) + StackOverflow(); +} + // methodDeclaration is NULL for default constructors void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool isTemporaryFunc, bool addToWorkList) { @@ -19588,6 +19595,8 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool BF_ASSERT(methodDef->mName != "__ASSERTNAME"); if (methodDef->mName == "__FATALERRORNAME") BFMODULE_FATAL(this, "__FATALERRORNAME"); + if (methodDef->mName == "__STACKOVERFLOW") + StackOverflow(); if (typeInstance->IsClosure()) {