Skip to content

Commit

Permalink
Rollup merge of #44362 - oli-obk:patch-7, r=eddyb
Browse files Browse the repository at this point in the history
Fix a bug in the inliner

r? @eddyb
  • Loading branch information
Mark-Simulacrum authored Sep 6, 2017
2 parents 7232d12 + 5bb870f commit ab729fb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/librustc_mir/transform/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,14 +606,20 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Integrator<'a, 'tcx> {
_location: Location) {
if *local == RETURN_POINTER {
match self.destination {
Lvalue::Local(l) => *local = l,
Lvalue::Local(l) => {
*local = l;
return;
},
ref lval => bug!("Return lvalue is {:?}, not local", lval)
}
}
let idx = local.index() - 1;
if idx < self.args.len() {
match self.args[idx] {
Operand::Consume(Lvalue::Local(l)) => *local = l,
Operand::Consume(Lvalue::Local(l)) => {
*local = l;
return;
},
ref op => bug!("Arg operand `{:?}` is {:?}, not local", idx, op)
}
}
Expand Down

0 comments on commit ab729fb

Please sign in to comment.