forked from OSchip/llvm-project
[cfi] Fix LowerBitSets on 32-bit targets.
This code attempts to truncate IntPtrTy to i32, which may be the same type. llvm-svn: 256205
This commit is contained in:
parent
2b9349db38
commit
fda72c52a2
|
@ -683,7 +683,7 @@ Constant *LowerBitSets::createJumpTableEntry(GlobalObject *Src, Function *Dest,
|
|||
ConstantInt *DispOffset =
|
||||
ConstantInt::get(IntPtrTy, Distance * kX86JumpTableEntrySize + 5);
|
||||
Constant *OffsetedDisp = ConstantExpr::getSub(Disp, DispOffset);
|
||||
OffsetedDisp = ConstantExpr::getTrunc(OffsetedDisp, Int32Ty);
|
||||
OffsetedDisp = ConstantExpr::getTruncOrBitCast(OffsetedDisp, Int32Ty);
|
||||
|
||||
ConstantInt *Int3 = ConstantInt::get(Int8Ty, kInt3Code);
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
; PR25902: gold plugin crash.
|
||||
; RUN: opt -mtriple=i686-pc -S -lowerbitsets < %s
|
||||
|
||||
define void @f(void ()* %p) {
|
||||
entry:
|
||||
%a = bitcast void ()* %p to i8*, !nosanitize !1
|
||||
%b = call i1 @llvm.bitset.test(i8* %a, metadata !"_ZTSFvvE"), !nosanitize !1
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @g() {
|
||||
entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
declare i1 @llvm.bitset.test(i8*, metadata)
|
||||
|
||||
!llvm.bitsets = !{!0}
|
||||
|
||||
!0 = !{!"_ZTSFvvE", void ()* @g, i64 0}
|
||||
!1 = !{}
|
Loading…
Reference in New Issue