[llvm-commits] [llvm] r49606 - /llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
Chris Lattner
sabre at nondot.org
Sun Apr 13 00:04:56 PDT 2008
Author: lattner
Date: Sun Apr 13 02:04:56 2008
New Revision: 49606
URL: http://llvm.org/viewvc/llvm-project?rev=49606&view=rev
Log:
Fix some serious logic errors that broke the jit on darwin/x86-64.
Modified:
llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=49606&r1=49605&r2=49606&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Sun Apr 13 02:04:56 2008
@@ -370,17 +370,17 @@
// 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;
}
More information about the llvm-commits
mailing list