mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
For PR1277:
Implement error handling for bytecode parsing. Patch by Scott Michel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35364 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
32eb1f1ca4
commit
497b0b0a45
@ -177,10 +177,13 @@ int main(int argc, char **argv) {
|
||||
sys::PrintStackTraceOnErrorSignal();
|
||||
|
||||
// Load the module to be compiled...
|
||||
std::string errmsg;
|
||||
std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename,
|
||||
Compressor::decompressToNewBuffer));
|
||||
Compressor::decompressToNewBuffer,
|
||||
&errmsg));
|
||||
if (M.get() == 0) {
|
||||
std::cerr << argv[0] << ": bytecode didn't read correctly.\n";
|
||||
std::cerr << "Reason: " << errmsg << "\n";
|
||||
return 1;
|
||||
}
|
||||
Module &mod = *M.get();
|
||||
|
Loading…
Reference in New Issue
Block a user