]> git.lizzy.rs Git - rust.git/commitdiff
Fix a bug in the inliner
authorOliver Schneider <oli-obk@users.noreply.github.com>
Wed, 6 Sep 2017 08:33:53 +0000 (10:33 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Sep 2017 08:33:53 +0000 (10:33 +0200)
src/librustc_mir/transform/inline.rs

index 3f8070fb3aa31929cb7b577060f64c9095978947..dc27da81978c1147781a1c5237fab77c6518fa43 100644 (file)
@@ -616,8 +616,9 @@ fn visit_local(&mut self,
                 Operand::Consume(Lvalue::Local(l)) => *local = l,
                 ref op => bug!("Arg operand `{:?}` is {:?}, not local", idx, op)
             }
+        } else {
+            *local = self.local_map[Local::new(idx - self.args.len())];
         }
-        *local = self.local_map[Local::new(idx - self.args.len())];
     }
 
     fn visit_lvalue(&mut self,