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

View File

@@ -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