diff options
| author | Graydon Hoare <[email protected]> | 2010-09-30 17:39:37 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-09-30 17:39:37 -0700 |
| commit | 2e0d07540702ac6cabcc5670660c72f898d5cbd2 (patch) | |
| tree | df48c5f8070eb55f00db7c435e569782dee26d09 /src/comp/middle | |
| parent | Drop slots on block exits even when blocks have no statements. Part way to fi... (diff) | |
| download | rust-2e0d07540702ac6cabcc5670660c72f898d5cbd2.tar.xz rust-2e0d07540702ac6cabcc5670660c72f898d5cbd2.zip | |
Fix bug in bind thunks failing top drop unbound args; add test and adjust rustc to use bind again.
Diffstat (limited to 'src/comp/middle')
| -rw-r--r-- | src/comp/middle/trans.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 1828271f..1e82ee8f 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -51,7 +51,7 @@ state type fn_ctxt = rec(ValueRef llfn, type terminator = fn(@fn_ctxt cx, builder build); tag cleanup { - clean(fn(@block_ctxt cx, ValueRef v), ValueRef); + clean(fn(@block_ctxt cx)); } state type block_ctxt = rec(BasicBlockRef llbb, @@ -303,8 +303,7 @@ fn trans_lit(@block_ctxt cx, &ast.lit lit) -> ValueRef { vec(p2i(C_str(cx.fcx.tcx, s)), C_int(len))); v = cx.build.IntToPtr(v, T_ptr(T_str())); - auto f = drop_str; - cx.cleanups += vec(clean(f, v)); + cx.cleanups += vec(clean(bind drop_str(_, v))); ret v; } } @@ -496,8 +495,8 @@ fn trans_block(@fn_ctxt cx, &ast.block b, terminator term) { for (cleanup c in bcx.cleanups) { alt (c) { - case (clean(?cfn, ?v)) { - cfn(bcx, v); + case (clean(?cfn)) { + cfn(bcx); } } } |