diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/ExprTypeConvert.cpp | 3 | ||||
-rw-r--r-- | lib/Transforms/TransformInternals.cpp | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp index 5975a21ff3..d716bca76d 100644 --- a/lib/Transforms/ExprTypeConvert.cpp +++ b/lib/Transforms/ExprTypeConvert.cpp @@ -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! diff --git a/lib/Transforms/TransformInternals.cpp b/lib/Transforms/TransformInternals.cpp index 6b42d0c766..f773a1c473 100644 --- a/lib/Transforms/TransformInternals.cpp +++ b/lib/Transforms/TransformInternals.cpp @@ -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 |