diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index 868bfbe5bec..082823ade7b 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -822,7 +822,7 @@ static GenericValue executeGEPOperation(Value *Ptr, User::op_iterator I, } else if (const SequentialType *ST = cast(Ty)) { // Get the index number for the array... which must be uint type... - assert((*I)->getType() == Type::UIntTy); + assert((*I)->getType() == Type::LongTy); unsigned Idx = getOperandValue(*I, SF).UIntVal; if (const ArrayType *AT = dyn_cast(ST)) if (Idx >= AT->getNumElements() && ArrayChecksEnabled) { diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp index 6c5caaf6bff..ce7e4dc0d92 100644 --- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp +++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp @@ -24,9 +24,6 @@ #include using std::vector; -//************************* Forward Declarations ***************************/ - - //************************ Internal Functions ******************************/ @@ -937,15 +934,6 @@ CreateCodeForFixedSizeAlloca(const TargetMachine& target, } - -// Check for a constant (uint) 0. -inline bool -IsZero(Value* idx) -{ - return (isa(idx) && cast(idx)->isNullValue()); -} - - //------------------------------------------------------------------------ // Function SetOperandsForMemInstr // @@ -1004,7 +992,8 @@ SetOperandsForMemInstr(vector& mvec, // offset. (An extra leading zero offset, if any, can be ignored.) // Generate code sequence to compute address from index. // - bool firstIdxIsZero = IsZero(idxVec[0]); + bool firstIdxIsZero = + (idxVec[0] == Constant::getNullValue(idxVec[0]->getType())); assert(idxVec.size() == 1U + firstIdxIsZero && "Array refs must be lowered before Instruction Selection");