mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
Make sure to delete the output file if there is an error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7481 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -431,7 +431,10 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
} catch (const std::string &Error) {
|
} catch (const std::string &Error) {
|
||||||
std::cerr << Error << "\n";
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -431,7 +431,10 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
} catch (const std::string &Error) {
|
} catch (const std::string &Error) {
|
||||||
std::cerr << Error << "\n";
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user