summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-06 03:46:41 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-06 03:46:41 +0000
commit1efc4aaf842428649468b897769bb8628c5fe362 (patch)
treef1ad8d219bdf2220d07a92833328a878a43049a4 /llvm/lib/ExecutionEngine
parent10dbc1e89650af5b6ad5c83770538954eefa0aad (diff)
downloadbcm5719-llvm-1efc4aaf842428649468b897769bb8628c5fe362.tar.gz
bcm5719-llvm-1efc4aaf842428649468b897769bb8628c5fe362.zip
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. llvm-svn: 34955
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index 4a0c58906a5..b19fa048cfd 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -1058,9 +1058,9 @@ GenericValue Interpreter::executeIntToPtrInst(Value *SrcVal, const Type *DstTy,
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;
OpenPOWER on IntegriCloud