Skip to content

Commit

Permalink
Fix garbled error messages from clang
Browse files Browse the repository at this point in the history
  • Loading branch information
LemonBoy authored and andrewrk committed Jan 16, 2020
1 parent 8a792db commit 0267afa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/zig_clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,9 @@ ZigClangASTUnit *ZigClangLoadFromCommandLine(const char **args_begin, const char
}

if (diags->hasErrorOccurred()) {
clang::ASTUnit *unit = ast_unit ? ast_unit : err_unit.get();
// Take ownership of the err_unit ASTUnit object so that it won't be
// free'd when we return, invalidating the error message pointers
clang::ASTUnit *unit = ast_unit ? ast_unit : err_unit.release();
ZigList<Stage2ErrorMsg> errors = {};

for (clang::ASTUnit::stored_diag_iterator it = unit->stored_diag_begin(),
Expand Down

0 comments on commit 0267afa

Please sign in to comment.