summaryrefslogtreecommitdiffstats
path: root/Source/cmLinkLibrariesCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-07-29 15:45:14 (GMT)
committerBrad King <brad.king@kitware.com>2004-07-29 15:45:14 (GMT)
commite3edb83c51c531670bef8850a0504de56d47c7a9 (patch)
tree5b3a6c9fddc1292bb169e41ade10f766677c356c /Source/cmLinkLibrariesCommand.cxx
parent8e13e2de901e25e1ee7c42031386dc099f74f2c1 (diff)
downloadCMake-e3edb83c51c531670bef8850a0504de56d47c7a9.zip
CMake-e3edb83c51c531670bef8850a0504de56d47c7a9.tar.gz
CMake-e3edb83c51c531670bef8850a0504de56d47c7a9.tar.bz2
BUG: Fixed crash when optimized/debug argument is not followed by a value.
Diffstat (limited to 'Source/cmLinkLibrariesCommand.cxx')
-rw-r--r--Source/cmLinkLibrariesCommand.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx
index 56d4937..c34cd3c 100644
--- a/Source/cmLinkLibrariesCommand.cxx
+++ b/Source/cmLinkLibrariesCommand.cxx
@@ -31,12 +31,22 @@ bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string> const& args)
if (*i == "debug")
{
++i;
+ if(i == args.end())
+ {
+ this->SetError("The \"debug\" argument must be followed by a library");
+ return false;
+ }
m_Makefile->AddLinkLibrary(i->c_str(),
cmTarget::DEBUG);
}
else if (*i == "optimized")
{
++i;
+ if(i == args.end())
+ {
+ this->SetError("The \"optimized\" argument must be followed by a library");
+ return false;
+ }
m_Makefile->AddLinkLibrary(i->c_str(),
cmTarget::OPTIMIZED);
}