Skip to content

Commit

Permalink
main: fixed possible crash / memory corruption due to a temporary value.
Browse files Browse the repository at this point in the history
  • Loading branch information
stnuessl committed Jan 5, 2017
1 parent 3c99472 commit b0a498f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,9 @@ int main(int argc, const char **argv)
TextDiagnosticPrinter Printer(llvm::errs(), &*Opts);
DiagnosticsEngine Diagnostics(Id, &*Opts, &Printer, false);
SourceManager SM(Diagnostics, Tool.getFiles());
LangOptions LangOpts;

Rewriter Rewriter(SM, LangOptions());
Rewriter Rewriter(SM, LangOpts);

bool ok = Tool.applyAllReplacements(Rewriter);
if (!ok) {
Expand Down

0 comments on commit b0a498f

Please sign in to comment.