Fix get_tydesc to alloca enough room for root; remove hack that was attempting to paper over it. Fix from espindola.

This commit is contained in:
Graydon Hoare 2011-03-28 11:10:47 -07:00
parent 1cb3ce89dd
commit 8b5968165f

View file

@ -1467,7 +1467,7 @@ fn get_tydesc(&@block_ctxt cx, @ty.t t) -> result {
auto root = cx.fcx.ccx.tydescs.get(t).tydesc; auto root = cx.fcx.ccx.tydescs.get(t).tydesc;
auto tydescs = cx.build.Alloca(T_array(T_ptr(T_tydesc(cx.fcx.ccx.tn)), auto tydescs = cx.build.Alloca(T_array(T_ptr(T_tydesc(cx.fcx.ccx.tn)),
n_params)); 1u /* for root*/ + n_params));
auto i = 0; auto i = 0;
auto tdp = cx.build.GEP(tydescs, vec(C_int(0), C_int(i))); 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,
// Use this when you're at the top block of a function or the like. // Use this when you're at the top block of a function or the like.
fn new_top_block_ctxt(@fn_ctxt fcx) -> @block_ctxt { fn new_top_block_ctxt(@fn_ctxt fcx) -> @block_ctxt {
auto cx = new_block_ctxt(fcx, parent_none, SCOPE_BLOCK, ret new_block_ctxt(fcx, parent_none, SCOPE_BLOCK,
"function top level"); "function top level");
// FIXME: hack to give us some spill room to make up for an LLVM
// bug where it destroys its own callee-saves.
cx.build.Alloca(T_array(T_int(), 10u));
ret cx;
} }
// Use this when you're at a curly-brace or similar lexical scope. // Use this when you're at a curly-brace or similar lexical scope.