summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestRunScriptCommand.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2018-12-14 22:24:52 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2019-01-23 14:52:29 (GMT)
commita6982cff0d3910723ad4fd40b9c63cf77c872d30 (patch)
treeb1e69a204006b7b1521c2994ff52b6c3e79b9715 /Source/CTest/cmCTestRunScriptCommand.cxx
parenta7f5cd45e135dd51d67176fc40e2d769ac5f7db8 (diff)
downloadCMake-a6982cff0d3910723ad4fd40b9c63cf77c872d30.zip
CMake-a6982cff0d3910723ad4fd40b9c63cf77c872d30.tar.gz
CMake-a6982cff0d3910723ad4fd40b9c63cf77c872d30.tar.bz2
cmMakefile: Impose maximum recursion limit
In order to keep infinitely-recursive scripts from causing a stack overflow in the CMake executable, CMake now imposes a maximum recursion limit before issuing an error message. The limit can be adjusted at runtime with CMAKE_MAXIMUM_RECURSION_DEPTH. Fixes: #18694
Diffstat (limited to 'Source/CTest/cmCTestRunScriptCommand.cxx')
-rw-r--r--Source/CTest/cmCTestRunScriptCommand.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestRunScriptCommand.cxx b/Source/CTest/cmCTestRunScriptCommand.cxx
index 238284a..a7e47d3 100644
--- a/Source/CTest/cmCTestRunScriptCommand.cxx
+++ b/Source/CTest/cmCTestRunScriptCommand.cxx
@@ -39,7 +39,8 @@ bool cmCTestRunScriptCommand::InitialPass(std::vector<std::string> const& args,
++i;
} else {
int ret;
- cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np, &ret);
+ cmCTestScriptHandler::RunScript(this->CTest, this->Makefile,
+ args[i].c_str(), !np, &ret);
std::ostringstream str;
str << ret;
this->Makefile->AddDefinition(returnVariable, str.str().c_str());