Index: lib/CodeGen/CodeGenFunction.cpp =================================================================== --- lib/CodeGen/CodeGenFunction.cpp +++ lib/CodeGen/CodeGenFunction.cpp @@ -1298,6 +1298,14 @@ Stmt *Body = FD->getBody(); + // TODO: As mentioned in the TODO added in https://reviews.llvm.org/rL280678, + // coro-split is not capable of moving spills whose users' users are not + // dominated by 'llvm.coro.begin'. '-fsanitize=null', for example, generates + // such code: null checks that occur before 'llvm.coro.begin'. For now, + // disable UBSan checks within coroutine function bodies. + if (Body && Body->getStmtClass() == Stmt::CoroutineBodyStmtClass) + SanOpts.clear(); + // Initialize helper which will detect jumps which can cause invalid lifetime // markers. if (Body && ShouldEmitLifetimeMarkers)