Skip to content

Commit ae06e3b

Browse files
committed
---
yaml --- r: 21838 b: refs/heads/snap-stage3 c: 1c5db46 h: refs/heads/master v: v3
1 parent 93e7b04 commit ae06e3b

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 24c89693f0556ba4b455df358a9136f7873776bf
4+
refs/heads/snap-stage3: 1c5db46f8e44441ba1aa11f0f607b7c015fd1fa5
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)