diff options
-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!"); |