diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-07-07 21:01:38 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-07-07 21:01:38 +0000 |
commit | e2947531280503a4e73e8d94a6161f68bea857a7 (patch) | |
tree | 4d3327ef434cd56b62be4cdfc3973a566b6a45e2 /lib | |
parent | 2834a4dd1d947461f53df000e2fba65cf99ba63c (diff) | |
download | external_llvm-e2947531280503a4e73e8d94a6161f68bea857a7.zip external_llvm-e2947531280503a4e73e8d94a6161f68bea857a7.tar.gz external_llvm-e2947531280503a4e73e8d94a6161f68bea857a7.tar.bz2 |
Fix for bug 391.
Improve exeception handling around bcreader invocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14674 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 2 | ||||
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 3 | ||||
-rw-r--r-- | lib/VMCore/Pass.cpp | 10 |
3 files changed, 14 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index c9fd577..4ece8b9 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -137,6 +137,8 @@ ExecutionEngine *ExecutionEngine::create(ModuleProvider *MP, } catch (...) { std::cerr << "Error creating the interpreter!\n"; } + } catch (std::string& errmsg) { + std::cerr << "Error reading the bytecode file: " << errmsg << "\n"; } catch (...) { std::cerr << "Error reading the bytecode file!\n"; } diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 5340a19..02577df 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -117,6 +117,9 @@ void *JIT::getPointerToFunction(Function *F) { // Make sure we read in the function if it exists in this Module try { MP->materializeFunction(F); + } catch ( std::string& errmsg ) { + std::cerr << "Error parsing bytecode file: " << errmsg << "\n"; + abort(); } catch (...) { std::cerr << "Error parsing bytecode file!\n"; abort(); diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index 8881329..b37b460 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -92,7 +92,15 @@ FunctionPassManager::~FunctionPassManager() { delete PM; } void FunctionPassManager::add(FunctionPass *P) { PM->add(P); } void FunctionPassManager::add(ImmutablePass *IP) { PM->add(IP); } bool FunctionPassManager::run(Function &F) { - MP->materializeFunction(&F); + try { + MP->materializeFunction(&F); + } catch (std::string& errstr) { + std::cerr << "Error reading bytecode file: " << errstr << "\n"; + abort(); + } catch (...) { + std::cerr << "Error reading bytecode file:\n"; + abort(); + } return PM->run(F); } |