Claim --param ssp-buffer-size, even if the stack protector is not

active.

llvm-svn: 163705
This commit is contained in:
Joerg Sonnenberger 2012-09-12 13:51:14 +00:00
parent 26d7a06da3
commit 85e2bbc3f8
1 changed files with 8 additions and 6 deletions

View File

@ -2346,17 +2346,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (StackProtectorLevel) {
CmdArgs.push_back("-stack-protector");
CmdArgs.push_back(Args.MakeArgString(Twine(StackProtectorLevel)));
}
// --param ssp-buffer-size=
for (arg_iterator it = Args.filtered_begin(options::OPT__param),
ie = Args.filtered_end(); it != ie; ++it) {
StringRef Str((*it)->getValue(Args));
if (Str.startswith("ssp-buffer-size=")) {
// --param ssp-buffer-size=
for (arg_iterator it = Args.filtered_begin(options::OPT__param),
ie = Args.filtered_end(); it != ie; ++it) {
StringRef Str((*it)->getValue(Args));
if (Str.startswith("ssp-buffer-size=")) {
if (StackProtectorLevel) {
CmdArgs.push_back("-stack-protector-buffer-size");
// FIXME: Verify the argument is a valid integer.
CmdArgs.push_back(Args.MakeArgString(Str.drop_front(16)));
(*it)->claim();
}
(*it)->claim();
}
}