summaryrefslogtreecommitdiffstats
path: root/Source/cmFunctionCommand.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/cmFunctionCommand.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/cmFunctionCommand.cxx')
-rw-r--r--Source/cmFunctionCommand.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 71c82d6..1359009 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -163,8 +163,11 @@ bool cmFunctionFunctionBlocker::Replay(
f.FilePath = this->GetStartingContext().FilePath;
f.Line = this->GetStartingContext().Line;
mf.RecordPolicies(f.Policies);
- mf.GetState()->AddScriptedCommand(this->Args.front(), std::move(f));
- return true;
+ return mf.GetState()->AddScriptedCommand(
+ this->Args.front(),
+ BT<cmState::Command>(std::move(f),
+ mf.GetBacktrace().Push(this->GetStartingContext())),
+ mf);
}
} // anonymous namespace