aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-28 21:57:33 +0000
committerChris Lattner <sabre@nondot.org>2002-04-28 21:57:33 +0000
commitcc82cc174c4afa974450ac1e32ec85cb4d5324a8 (patch)
tree20cfbae4bc8f10cfd90beab69b5d95e3e6a6c274 /lib/ExecutionEngine
parente6ef6690b08d855b1c7ab852d82b6399d93db6af (diff)
downloadexternal_llvm-cc82cc174c4afa974450ac1e32ec85cb4d5324a8.zip
external_llvm-cc82cc174c4afa974450ac1e32ec85cb4d5324a8.tar.gz
external_llvm-cc82cc174c4afa974450ac1e32ec85cb4d5324a8.tar.bz2
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
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 321003c..2a8c105 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/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.