mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
FIXME removed: malloc/alloca ALWAYS have a size argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2389 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -731,14 +731,9 @@ void Interpreter::executeBrInst(BranchInst *I, ExecutionContext &SF) {
|
|||||||
|
|
||||||
void Interpreter::executeAllocInst(AllocationInst *I, ExecutionContext &SF) {
|
void Interpreter::executeAllocInst(AllocationInst *I, ExecutionContext &SF) {
|
||||||
const Type *Ty = I->getType()->getElementType(); // Type to be allocated
|
const Type *Ty = I->getType()->getElementType(); // Type to be allocated
|
||||||
unsigned NumElements = 1;
|
|
||||||
|
|
||||||
// FIXME: Malloc/Alloca should always have an argument!
|
|
||||||
if (I->getNumOperands()) { // Allocating a unsized array type?
|
|
||||||
// Get the number of elements being allocated by the array...
|
// Get the number of elements being allocated by the array...
|
||||||
GenericValue NumEl = getOperandValue(I->getOperand(0), SF);
|
unsigned NumElements = getOperandValue(I->getOperand(0), SF).UIntVal;
|
||||||
NumElements = NumEl.UIntVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allocate enough memory to hold the type...
|
// Allocate enough memory to hold the type...
|
||||||
// FIXME: Don't use CALLOC, use a tainted malloc.
|
// FIXME: Don't use CALLOC, use a tainted malloc.
|
||||||
|
Reference in New Issue
Block a user