mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
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
This commit is contained in:
parent
3636f4e0d6
commit
2fa8212a7a
@ -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!");
|
||||
|
Loading…
Reference in New Issue
Block a user