cmState: Prohibit override of flow control commands

This commit is contained in:
Kyle Edwards
2020-10-22 16:50:42 -04:00
parent 3a82ff6a11
commit 8aee7fdb32
23 changed files with 108 additions and 21 deletions
+5 -2
View File
@@ -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);
}
}