diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-06 03:46:41 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-06 03:46:41 +0000 |
commit | 576310512118071393e3f216e1fd4108b0823e56 (patch) | |
tree | f165437f21a18378740cbd9c5358e136b90f70ba /lib/ExecutionEngine/Interpreter | |
parent | 7553c341354c7790cebda40ea0d647f9d204544b (diff) | |
download | external_llvm-576310512118071393e3f216e1fd4108b0823e56.zip external_llvm-576310512118071393e3f216e1fd4108b0823e56.tar.gz external_llvm-576310512118071393e3f216e1fd4108b0823e56.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Execution.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index 4a0c589..b19fa04 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/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; |