mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-18 17:55:18 +00:00
Make sure to delete the output file if there is an error
llvm-svn: 7481
This commit is contained in:
parent
346760c6cb
commit
55c9211b80
@ -431,7 +431,10 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
} catch (const std::string &Error) {
|
||||
std::cerr << Error << "\n";
|
||||
if (Out != &std::cout) delete Out;
|
||||
if (Out != &std::cout) {
|
||||
delete Out; // Close the file
|
||||
std::remove(OutputFilename.c_str()); // Remove the file, it's broken
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user