Skip to content

Commit 8b59681

Browse files
committed
Fix get_tydesc to alloca enough room for root; remove hack that was attempting to paper over it. Fix from espindola.
1 parent 1cb3ce8 commit 8b59681

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/comp/middle/trans.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ fn get_tydesc(&@block_ctxt cx, @ty.t t) -> result {
14671467
auto root = cx.fcx.ccx.tydescs.get(t).tydesc;
14681468

14691469
auto tydescs = cx.build.Alloca(T_array(T_ptr(T_tydesc(cx.fcx.ccx.tn)),
1470-
n_params));
1470+
1u /* for root*/ + n_params));
14711471

14721472
auto i = 0;
14731473
auto tdp = cx.build.GEP(tydescs, vec(C_int(0), C_int(i)));
@@ -5076,13 +5076,8 @@ fn new_block_ctxt(@fn_ctxt cx, block_parent parent,
50765076

50775077
// Use this when you're at the top block of a function or the like.
50785078
fn new_top_block_ctxt(@fn_ctxt fcx) -> @block_ctxt {
5079-
auto cx = new_block_ctxt(fcx, parent_none, SCOPE_BLOCK,
5080-
"function top level");
5081-
5082-
// FIXME: hack to give us some spill room to make up for an LLVM
5083-
// bug where it destroys its own callee-saves.
5084-
cx.build.Alloca(T_array(T_int(), 10u));
5085-
ret cx;
5079+
ret new_block_ctxt(fcx, parent_none, SCOPE_BLOCK,
5080+
"function top level");
50865081
}
50875082

50885083
// Use this when you're at a curly-brace or similar lexical scope.

0 commit comments

Comments
 (0)