Skip to content

Fix some uninitialized pointer usage in Driver #1683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4744,7 +4744,7 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
}
UnbundlerInputs.push_back(LI);
}
const Arg *LastArg;
const Arg *LastArg = nullptr;
auto addUnbundlerInput = [&](types::ID T, const StringRef &A) {
const llvm::opt::OptTable &Opts = getOpts();
Arg *InputArg = MakeInputArg(Args, Opts, C.getArgs().MakeArgString(A));
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7708,7 +7708,8 @@ void SYCLPostLink::ConstructJob(Compilation &C, const JobAction &JA,
addArgs(CmdArgs, TCArgs, {"-symbols"});
}
// specialization constants processing is mandatory
if (llvm::dyn_cast<SYCLPostLinkJobAction>(&JA)->getRTSetsSpecConstants())
auto *SYCLPostLink = llvm::dyn_cast<SYCLPostLinkJobAction>(&JA);
if (SYCLPostLink && SYCLPostLink->getRTSetsSpecConstants())
addArgs(CmdArgs, TCArgs, {"-spec-const=rt"});
else
addArgs(CmdArgs, TCArgs, {"-spec-const=default"});
Expand Down