llvm.org GIT mirror llvm / 3b15c97
msan: Stop stripping the 'tail' modifier off of calls This probably isn't necessary since msan started to unpoison the return value shadow memory before all calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212061 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 5 years ago
2 changed file(s) with 14 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
22712271 return;
22722272 }
22732273
2274 // Allow only tail calls with the same types, otherwise
2275 // we may have a false positive: shadow for a non-void RetVal
2276 // will get propagated to a void RetVal.
2277 if (Call->isTailCall() && Call->getType() != Call->getParent()->getType())
2278 Call->setTailCall(false);
2279
22802274 assert(!isa(&I) && "intrinsics are handled elsewhere");
22812275
22822276 // We are going to insert code that relies on the fact that the callee
824824 ; CHECK: store i64 16, i64* @__msan_va_arg_overflow_size_tls
825825 ; CHECK: call void (i32, ...)* @VAArgStructFn
826826 ; CHECK: ret void
827
828 declare i32 @InnerTailCall(i32 %a)
829
830 define void @MismatchedReturnTypeTailCall(i32 %a) {
831 %b = tail call i32 @InnerTailCall(i32 %a)
832 ret void
833 }
834
835 ; We used to strip off the 'tail' modifier, but now that we unpoison return slot
836 ; shadow before the call, we don't need to anymore.
837
838 ; CHECK-LABEL: define void @MismatchedReturnTypeTailCall
839 ; CHECK: tail call i32 @InnerTailCall
840 ; CHECK: ret void