From 079abd0b1ea7d087586de53f49fa129aacd26ca4 Mon Sep 17 00:00:00 2001 From: Mark Simulacrum Date: Tue, 20 Dec 2016 14:14:30 -0700 Subject: [PATCH] Reuse cleanup pad declared at start of block. --- src/librustc_trans/cleanup.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc_trans/cleanup.rs b/src/librustc_trans/cleanup.rs index 9409ac5f8e1c..add820748acf 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