diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-04-28 21:57:33 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-04-28 21:57:33 +0000 |
| commit | 0ebb7930c9974e04b10e2787487227d0e677c3f3 (patch) | |
| tree | 6753c3c99e3195829751be3c3d27338d73728b68 | |
| parent | 450bda1a42f6b1dde9f12962e21b3fa6cc008133 (diff) | |
| download | bcm5719-llvm-0ebb7930c9974e04b10e2787487227d0e677c3f3.tar.gz bcm5719-llvm-0ebb7930c9974e04b10e2787487227d0e677c3f3.zip | |
FIXME removed: malloc/alloca ALWAYS have a size argument
llvm-svn: 2389
| -rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp index 321003c1fdc..2a8c10506b5 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -731,14 +731,9 @@ void Interpreter::executeBrInst(BranchInst *I, ExecutionContext &SF) { void Interpreter::executeAllocInst(AllocationInst *I, ExecutionContext &SF) { 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... - GenericValue NumEl = getOperandValue(I->getOperand(0), SF); - NumElements = NumEl.UIntVal; - } + // Get the number of elements being allocated by the array... + unsigned NumElements = getOperandValue(I->getOperand(0), SF).UIntVal; // Allocate enough memory to hold the type... // FIXME: Don't use CALLOC, use a tainted malloc. |

