summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-10-22 20:50:42 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-10-22 21:04:31 (GMT)
commit8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b (patch)
tree3854ce6ac00cc25aa55905af070f2b91d0569504 /Source/cmMacroCommand.cxx
parent3a82ff6a11d643c4a5959f65ea538a3b60784a16 (diff)
downloadCMake-8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b.zip
CMake-8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b.tar.gz
CMake-8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b.tar.bz2
cmState: Prohibit override of flow control commands
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 98f88c1..8c4b2a7 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -171,8 +171,11 @@ bool cmMacroFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
f.Functions = std::move(functions);
f.FilePath = this->GetStartingContext().FilePath;
mf.RecordPolicies(f.Policies);
- mf.GetState()->AddScriptedCommand(this->Args[0], std::move(f));
- return true;
+ return mf.GetState()->AddScriptedCommand(
+ this->Args[0],
+ BT<cmState::Command>(std::move(f),
+ mf.GetBacktrace().Push(this->GetStartingContext())),
+ mf);
}
}