Merge pull request #1031 from jbrodman/master

Ptr Diff should ignore const
This commit is contained in:
Dmitry Babokin
2015-04-30 13:38:59 +03:00

View File

@@ -1461,7 +1461,7 @@ lEmitBinaryPointerArith(BinaryExpr::Op op, llvm::Value *value0,
break;
case BinaryExpr::Sub: {
if (CastType<PointerType>(type1) != NULL) {
AssertPos(pos, Type::Equal(type0, type1));
AssertPos(pos, Type::EqualIgnoringConst(type0, type1));
if (ptrType->IsSlice()) {
llvm::Value *p0 = ctx->ExtractInst(value0, 0);