diff options
author | Chris Lattner <sabre@nondot.org> | 2006-07-07 17:31:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-07-07 17:31:41 +0000 |
commit | c1780d2a0a22b0b7d9fcc227c3b31c28390ceecc (patch) | |
tree | b29e4f6aa2eca65fac702a9cfc370ec30bf5cdad /lib/ExecutionEngine/JIT | |
parent | a5c04d6806bdfa15103a1c0c8a425cc8b67193a7 (diff) | |
download | external_llvm-c1780d2a0a22b0b7d9fcc227c3b31c28390ceecc.zip external_llvm-c1780d2a0a22b0b7d9fcc227c3b31c28390ceecc.tar.gz external_llvm-c1780d2a0a22b0b7d9fcc227c3b31c28390ceecc.tar.bz2 |
Change AllocateRWX/DeallocateRWX do not throw an exception.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29057 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT')
-rw-r--r-- | lib/ExecutionEngine/JIT/JITEmitter.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp index ef9e43a..5e13016 100644 --- a/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -414,17 +414,17 @@ unsigned char *JITMemoryManager::allocateStub(unsigned StubSize) { } sys::MemoryBlock JITMemoryManager::getNewMemoryBlock(unsigned size) { - try { - // Allocate a new block close to the last one. - const sys::MemoryBlock *BOld = Blocks.empty() ? 0 : &Blocks.front(); - sys::MemoryBlock B = sys::Memory::AllocateRWX(size, BOld); - Blocks.push_back(B); - return B; - } catch (std::string &err) { + // Allocate a new block close to the last one. + const sys::MemoryBlock *BOld = Blocks.empty() ? 0 : &Blocks.front(); + std::string ErrMsg; + sys::MemoryBlock B = sys::Memory::AllocateRWX(size, BOld, &ErrMsg); + if (B.base() == 0) { std::cerr << "Allocation failed when allocating new memory in the JIT\n"; - std::cerr << err << "\n"; + std::cerr << ErrMsg << "\n"; abort(); } + Blocks.push_back(B); + return B; } //===----------------------------------------------------------------------===// |