mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
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
This commit is contained in:
parent
7553c34135
commit
5763105121
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user