Skip to content

Commit 949b251

Browse files
committed
---
yaml --- r: 7102 b: refs/heads/master c: 6237368 h: refs/heads/master v: v3
1 parent 8e40ca1 commit 949b251

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: d1b987d292cc0f4fa412d18b051ce8681256bb61
2+
refs/heads/master: 6237368cc2e640e50ee3616386be65e7f0fc98ad

trunk/src/comp/middle/trans.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,10 @@ fn make_free_glue(bcx: @block_ctxt, v: ValueRef, t: ty::t) {
13861386
ty::ty_send_type. {
13871387
// sendable type descriptors are basically unique pointers,
13881388
// they must be freed.
1389-
trans_shared_free(bcx, v)
1389+
let ccx = bcx_ccx(bcx);
1390+
let v = PointerCast(bcx, v, T_ptr(ccx.tydesc_type));
1391+
Call(bcx, ccx.upcalls.free_shared_type_desc, [v]);
1392+
bcx
13901393
}
13911394
ty::ty_native_fn(_, _) | ty::ty_fn(_) {
13921395
trans_closure::make_fn_glue(bcx, v, t, free_ty)

trunk/src/comp/middle/trans_closure.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ fn make_opaque_cbox_free_glue(
736736
}
737737

738738
let ccx = bcx_ccx(bcx);
739+
let tcx = bcx_tcx(bcx);
739740
make_null_test(bcx, cbox) {|bcx|
740741
// Load the type descr found in the cbox
741742
let lltydescty = T_ptr(ccx.tydesc_type);
@@ -763,7 +764,7 @@ fn make_opaque_cbox_free_glue(
763764
trans_free_if_not_gc(bcx, cbox)
764765
}
765766
ty::closure_send. {
766-
let bcx = trans_shared_free(bcx, tydesc);
767+
let bcx = free_ty(bcx, tydesc, mk_tydesc_ty(tcx, ck));
767768
trans_shared_free(bcx, cbox)
768769
}
769770
}

trunk/src/rt/rust_upcall.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ void upcall_s_free_shared_type_desc(type_desc *td)
293293

294294
extern "C" CDECL void
295295
upcall_free_shared_type_desc(type_desc *td) {
296-
UPCALL_SWITCH_STACK(td, upcall_s_free_shared_type_desc);
296+
if (td) {
297+
UPCALL_SWITCH_STACK(td, upcall_s_free_shared_type_desc);
298+
}
297299
}
298300

299301
/**********************************************************************

trunk/src/test/run-pass/sendfn-deep-copy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import std::comm::send;
66

77
fn main() { test05(); }
88

9-
fn mk_counter<copy A>() -> sendfn(A) -> (A,uint) {
9+
fn mk_counter<A:copy>() -> sendfn(A) -> (A,uint) {
1010
// The only reason that the counter is generic is so that it closes
1111
// over both a type descriptor and some data.
1212
let v = [mutable 0u];

0 commit comments

Comments
 (0)