Skip to content

Commit 3f92ecc

Browse files
committed
Revert r215415 which causse MSan to crash on a great deal of C++ code.
I've followed up on the original commit as well. llvm-svn: 215532
1 parent 76244be commit 3f92ecc

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,12 +2356,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
23562356
VAHelper->visitCallSite(CS, IRB);
23572357
}
23582358

2359-
// If this is a musttail call site, we can't insert propagation code here.
2360-
// The return type of the caller must match the callee, so the shadow should
2361-
// already be set up for an immediate return.
2362-
if (CS.isMustTailCall())
2363-
return;
2364-
23652359
// Now, get the shadow for the RetVal.
23662360
if (!I.getType()->isSized()) return;
23672361
IRBuilder<> IRBBefore(&I);
@@ -2395,10 +2389,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
23952389
}
23962390

23972391
void visitReturnInst(ReturnInst &I) {
2398-
// Don't propagate shadow between musttail calls and the return.
2399-
if (I.getParent()->getTerminatingMustTailCall())
2400-
return;
2401-
24022392
IRBuilder<> IRB(&I);
24032393
Value *RetVal = I.getReturnValue();
24042394
if (!RetVal) return;

llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -878,16 +878,3 @@ define void @MismatchedReturnTypeTailCall(i32 %a) sanitize_memory {
878878
; CHECK-LABEL: define void @MismatchedReturnTypeTailCall
879879
; CHECK: tail call i32 @InnerTailCall
880880
; CHECK: ret void
881-
882-
declare i32 @InnerMustTailCall(i32 %a)
883-
884-
define i32 @MustTailCall(i32 %a) {
885-
%b = musttail call i32 @InnerMustTailCall(i32 %a)
886-
ret i32 %b
887-
}
888-
889-
; Test that 'musttail' is preserved. The ABI should make this work.
890-
891-
; CHECK-LABEL: define i32 @MustTailCall
892-
; CHECK: musttail call i32 @InnerMustTailCall
893-
; CHECK-NEXT: ret i32

0 commit comments

Comments
 (0)