1. Don't swap byte order in scanf. It isn't necessary and leads to
authorReid Spencer <rspencer@reidspencer.com>
Thu, 26 Apr 2007 18:19:35 +0000 (18:19 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Thu, 26 Apr 2007 18:19:35 +0000 (18:19 +0000)
   incorrect results (canonicalization was dropped several commits ago).
2. Add support for fscanf.
3. Suppress a warning about cast to pointer from non-pointer-sized integer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36482 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/Interpreter/Execution.cpp

index 98213c882df823c3645d5de6833928ffa0e25b19..ddfaffd87da578ab5b007a66522830234f26fe77 100644 (file)
@@ -1073,7 +1073,7 @@ GenericValue Interpreter::executeIntToPtrInst(Value *SrcVal, const Type *DstTy,
   if (PtrSize != Src.IntVal.getBitWidth())
     Src.IntVal = Src.IntVal.zextOrTrunc(PtrSize);
 
-  Dest.PointerVal = (PointerTy) Src.IntVal.getZExtValue();
+  Dest.PointerVal = PointerTy(intptr_t(Src.IntVal.getZExtValue()));
   return Dest;
 }