Skip to content

Commit a1a05c4

Browse files
committed
---
yaml --- r: 32608 b: refs/heads/dist-snap c: 1c5db46 h: refs/heads/master v: v3
1 parent 8baf1a1 commit a1a05c4

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 24c89693f0556ba4b455df358a9136f7873776bf
10+
refs/heads/dist-snap: 1c5db46f8e44441ba1aa11f0f607b7c015fd1fa5
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/libcore/cleanup.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ struct Task {
7171
#[lang="annihilate"]
7272
pub unsafe fn annihilate() {
7373
use rt::rt_free;
74+
use io::WriterUtil;
7475

7576
let task: *Task = transmute(rustrt::rust_get_task());
7677

7778
// Pass 1: Make all boxes immortal.
7879
let box = (*task).boxed_region.live_allocs;
7980
let mut box: *mut BoxRepr = transmute(copy box);
80-
assert (*box).prev == null();
8181
while box != mut_null() {
8282
debug!("making box immortal: %x", box as uint);
8383
(*box).ref_count = 0x77777777;
@@ -87,7 +87,6 @@ pub unsafe fn annihilate() {
8787
// Pass 2: Drop all boxes.
8888
let box = (*task).boxed_region.live_allocs;
8989
let mut box: *mut BoxRepr = transmute(copy box);
90-
assert (*box).prev == null();
9190
while box != mut_null() {
9291
debug!("calling drop glue for box: %x", box as uint);
9392
let tydesc: *TypeDesc = transmute(copy (*box).type_desc);

branches/dist-snap/src/rustc/middle/trans/base.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,17 +1984,22 @@ fn create_main_wrapper(ccx: @crate_ctxt, sp: span, main_llfn: ValueRef,
19841984
let bcx = top_scope_block(fcx, None);
19851985
let lltop = bcx.llbb;
19861986

1987+
// Call main.
19871988
let lloutputarg = llvm::LLVMGetParam(llfdecl, 0 as c_uint);
19881989
let llenvarg = llvm::LLVMGetParam(llfdecl, 1 as c_uint);
19891990
let mut args = ~[lloutputarg, llenvarg];
19901991
if takes_argv {
19911992
vec::push(args, llvm::LLVMGetParam(llfdecl, 2 as c_uint));
19921993
}
19931994
Call(bcx, main_llfn, args);
1994-
build_return(bcx);
19951995

1996-
finish_fn(fcx, lltop);
1996+
// Call the box annihilator.
1997+
let did = bcx.tcx().lang_items.annihilate_fn.get();
1998+
let bcx = callee::trans_rtcall_or_lang_call(bcx, did, ~[],
1999+
expr::Ignore);
19972000

2001+
build_return(bcx);
2002+
finish_fn(fcx, lltop);
19982003
return llfdecl;
19992004
}
20002005

0 commit comments

Comments
 (0)