Bug fix for test/Regression/Other/2002-02-14-LevelRaiseBadAssert.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1767 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-02-14 22:21:40 +00:00
parent 4ed5534a8f
commit 868c2d3c05
2 changed files with 2 additions and 2 deletions

View File

@ -307,8 +307,7 @@ bool ExpressionConvertableToType(Value *V, const Type *Ty,
//
std::vector<Value*> Indices;
const Type *ElTy = ConvertableToGEP(PTy, I->getOperand(1), Indices);
if (ElTy) {
assert(ElTy == PVTy && "Internal error, setup wrong!");
if (ElTy == PVTy) {
if (!ExpressionConvertableToType(I->getOperand(0),
PointerType::get(ElTy), CTMap))
return false; // Can't continue, ExConToTy might have polluted set!

View File

@ -155,6 +155,7 @@ const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal,
int Val = getConstantValue(Expr.Scale);
if (Val < 0) return false; // Don't mess with negative scales
Scale = (unsigned)Val;
if (Scale == 1) Scale = 0; // No interesting scale if *1
}
// Loop over the Scale and Offset values, filling in the Indices vector for