Don't inline tainted MIR bodies
This commit is contained in:
parent
c7b0d4e81f
commit
65b029b468
3 changed files with 42 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue