1
Fork 0

Don't inline tainted MIR bodies

This commit is contained in:
Michael Goulet 2024-08-03 15:33:02 -04:00
parent c7b0d4e81f
commit 65b029b468
3 changed files with 42 additions and 2 deletions

View file

@ -505,6 +505,10 @@ impl<'tcx> Inliner<'tcx> {
) -> Result<(), &'static str> {
let tcx = self.tcx;
if let Some(_) = callee_body.tainted_by_errors {
return Err("Body is tainted");
}
let mut threshold = if self.caller_is_inline_forwarder {
self.tcx.sess.opts.unstable_opts.inline_mir_forwarder_threshold.unwrap_or(30)
} else if cross_crate_inlinable {