diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-13 07:04:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-13 07:04:56 +0000 |
commit | 3b374489041ac28153c84194dda45e182d8939fc (patch) | |
tree | 3ded57d93d9a6134cf127fe87066a6af4ca63aab /lib/ExecutionEngine | |
parent | 89f6d88db334ba088672ae0753deb7d7b7509bac (diff) | |
download | external_llvm-3b374489041ac28153c84194dda45e182d8939fc.zip external_llvm-3b374489041ac28153c84194dda45e182d8939fc.tar.gz external_llvm-3b374489041ac28153c84194dda45e182d8939fc.tar.bz2 |
Fix some serious logic errors that broke the jit on darwin/x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/JIT/JITEmitter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp index 2277897..64d3cd7 100644 --- a/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -370,17 +370,17 @@ static void AddFunctionToSymbolTable(const char *FnName, // If we have space in the table, reallocate the table. if (SymTabPtr->NumSymbols >= SymTabPtr->NumAllocated) { // If we don't have space, reallocate the table. - unsigned NewSize = std::min(64U, SymTabPtr->NumAllocated*2); + unsigned NewSize = std::max(64U, SymTabPtr->NumAllocated*2); JitSymbolEntry *NewSymbols = new JitSymbolEntry[NewSize]; JitSymbolEntry *OldSymbols = SymTabPtr->Symbols; // Copy the old entries over. memcpy(NewSymbols, OldSymbols, - SymTabPtr->NumAllocated*sizeof(JitSymbolEntry)); + SymTabPtr->NumSymbols*sizeof(OldSymbols[0])); // Swap the new symbols in, delete the old ones. SymTabPtr->Symbols = NewSymbols; - SymTabPtr->NumSymbols = NewSize; + SymTabPtr->NumAllocated = NewSize; delete [] OldSymbols; } |