diff options
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r-- | lib/VMCore/Instructions.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index fe30271f84..0dd69a18bc 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -2220,6 +2220,8 @@ CastInst::getCastOpcode( } else { assert(isa<PointerType>(SrcTy) && "Casting from a value that is not first-class type"); + assert(!SrcIsSigned && + "Pointer types cannot be considered signed for conversions!"); return PtrToInt; // ptr -> int } } else if (DestTy->isFloatingPoint()) { // Casting to floating pt @@ -2259,6 +2261,7 @@ CastInst::getCastOpcode( if (isa<PointerType>(SrcTy)) { return BitCast; // ptr -> ptr } else if (SrcTy->isInteger()) { + assert(!SrcIsSigned && "Cannot cast signed integer to pointer!"); return IntToPtr; // int -> ptr } else { assert(!"Casting pointer to other than pointer or int"); |