diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-11-05 01:02:14 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-11-05 01:02:14 +0000 |
commit | 2fa8212a7a7fc089751831a046ab4798a7dabba7 (patch) | |
tree | 9d7a7b21cbe0b8b8f4287c5ccc2ddbdf2aec2df4 | |
parent | 3636f4e0d68858cb7b521a90cb3235852301c2b3 (diff) | |
download | external_llvm-2fa8212a7a7fc089751831a046ab4798a7dabba7.zip external_llvm-2fa8212a7a7fc089751831a046ab4798a7dabba7.tar.gz external_llvm-2fa8212a7a7fc089751831a046ab4798a7dabba7.tar.bz2 |
Use regular old malloc to emulate malloc/alloca instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9713 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Execution.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index 66b8b54..783feb1 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -546,8 +546,7 @@ void Interpreter::visitAllocationInst(AllocationInst &I) { unsigned NumElements = getOperandValue(I.getOperand(0), SF).UIntVal; // Allocate enough memory to hold the type... - // FIXME: Don't use CALLOC, use a tainted malloc. - void *Memory = calloc(NumElements, TD.getTypeSize(Ty)); + void *Memory = malloc(NumElements * TD.getTypeSize(Ty)); GenericValue Result = PTOGV(Memory); assert(Result.PointerVal != 0 && "Null pointer returned by malloc!"); |