about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2016-12-20 14:14:30 -0700
committerMark Simulacrum <mark.simulacrum@gmail.com>2016-12-20 20:04:46 -0700
commit079abd0b1ea7d087586de53f49fa129aacd26ca4 (patch)
tree467d2d5151a021f849771cf9912fbc60c7e06430
parentc1bc5e51d6cb6ea997da1757e16ddb1b9093d25e (diff)
downloadrust-079abd0b1ea7d087586de53f49fa129aacd26ca4.tar.gz
rust-079abd0b1ea7d087586de53f49fa129aacd26ca4.zip
Reuse cleanup pad declared at start of block.
-rw-r--r--src/librustc_trans/cleanup.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_trans/cleanup.rs b/src/librustc_trans/cleanup.rs
index 9409ac5f8e1..add820748ac 100644
--- a/src/librustc_trans/cleanup.rs
+++ b/src/librustc_trans/cleanup.rs
@@ -59,11 +59,11 @@ impl<'tcx> DropValue<'tcx> {
         bcx.set_personality_fn(llpersonality);
 
         if base::wants_msvc_seh(fcx.ccx.sess()) {
-            // Insert cleanup instructions into the cleanup block
-            let funclet = Some(Funclet::new(bcx.cleanup_pad(None, &[])));
+            let pad = bcx.cleanup_pad(None, &[]);
+            let funclet = Some(Funclet::new(pad));
             self.trans(funclet.as_ref(), &bcx);
 
-            bcx.cleanup_ret(bcx.cleanup_pad(None, &[]), None);
+            bcx.cleanup_ret(pad, None);
         } else {
             // The landing pad return type (the type being propagated). Not sure
             // what this represents but it's determined by the personality