about summary refs log tree commit diff
path: root/src/rustc/middle
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-04-24 14:16:50 -0700
committerBrian Anderson <banderson@mozilla.com>2012-04-24 14:55:16 -0700
commite7dbf42214c5dfe39b8fd6896171aaa8feee7582 (patch)
tree461537fc368efdd0c047635a70c33b5e7e4fa68d /src/rustc/middle
parent5437a045fc653eea0efafb28f0e13b12f0bfa3d5 (diff)
rustc: Fix type_need_unwind_cleanup. Closes #2272
Diffstat (limited to 'src/rustc/middle')
-rw-r--r--src/rustc/middle/ty.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs
index 2d5a68d08ab..68da6e6d734 100644
--- a/src/rustc/middle/ty.rs
+++ b/src/rustc/middle/ty.rs
@@ -1176,7 +1176,8 @@ fn type_needs_unwind_cleanup_(cx: ctxt, ty: t,
     let mut encountered_box = encountered_box;
     let mut needs_unwind_cleanup = false;
     maybe_walk_ty(ty) {|ty|
-        alt get(ty).struct {
+        let old_encountered_box = encountered_box;
+        let result = alt get(ty).struct {
           ty_box(_) | ty_opaque_box {
             encountered_box = true;
             true
@@ -1216,7 +1217,10 @@ fn type_needs_unwind_cleanup_(cx: ctxt, ty: t,
             needs_unwind_cleanup = true;
             false
           }
-        }
+        };
+
+        encountered_box = old_encountered_box;
+        result
     }
 
     ret needs_unwind_cleanup;