[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp

Reid Spencer reid at x10sys.com
Mon Mar 5 19:46:58 PST 2007



Changes in directory llvm/lib/ExecutionEngine/Interpreter:

Execution.cpp updated: 1.174 -> 1.175
---
Log message:

Fix some thinko's in the last patch. PtrSize has to be in bits and we 
might need to zext not just trunc the value.


---
Diffs of the changes:  (+2 -2)

 Execution.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.174 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.175
--- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.174	Mon Mar  5 21:41:50 2007
+++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp	Mon Mar  5 21:46:41 2007
@@ -1058,9 +1058,9 @@
   GenericValue Dest, Src = getOperandValue(SrcVal, SF);
   assert(isa<PointerType>(DstTy) && "Invalid PtrToInt instruction");
 
-  uint32_t PtrSize = TD.getPointerSize();
+  uint32_t PtrSize = TD.getPointerSizeInBits();
   if (PtrSize != Src.IntVal.getBitWidth())
-    Src.IntVal = Src.IntVal.trunc(PtrSize);
+    Src.IntVal = Src.IntVal.zextOrTrunc(PtrSize);
 
   Dest.PointerVal = (PointerTy) Src.IntVal.getZExtValue();
   return Dest;






More information about the llvm-commits mailing list