rustc: Pass actual tydescs to upcall_malloc
This commit is contained in:
parent
78147452b8
commit
d607316b2f
1 changed files with 8 additions and 4 deletions
|
@ -837,13 +837,17 @@ fn trans_malloc_boxed_raw(cx: @block_ctxt, t: ty::t) -> result {
|
||||||
// wants.
|
// wants.
|
||||||
// FIXME: Could avoid this check with a postcondition on mk_imm_box?
|
// FIXME: Could avoid this check with a postcondition on mk_imm_box?
|
||||||
// (requires Issue #586)
|
// (requires Issue #586)
|
||||||
let ccx = bcx_ccx(cx);
|
let ccx = bcx_ccx(bcx);
|
||||||
let sp = cx.sp;
|
let sp = bcx.sp;
|
||||||
check (type_has_static_size(ccx, box_ptr));
|
check (type_has_static_size(ccx, box_ptr));
|
||||||
let llty = type_of(ccx, sp, box_ptr);
|
let llty = type_of(ccx, sp, box_ptr);
|
||||||
|
|
||||||
let tydesc = C_null(T_ptr(ccx.tydesc_type));
|
let ti = none;
|
||||||
let rval = Call(cx, ccx.upcalls.malloc, [cx.fcx.lltaskptr, llsz, tydesc]);
|
let tydesc_result = get_tydesc(bcx, t, true, tps_normal, ti);
|
||||||
|
let lltydesc = tydesc_result.result.val; bcx = tydesc_result.result.bcx;
|
||||||
|
|
||||||
|
let rval = Call(cx, ccx.upcalls.malloc,
|
||||||
|
[cx.fcx.lltaskptr, llsz, lltydesc]);
|
||||||
ret rslt(cx, PointerCast(cx, rval, llty));
|
ret rslt(cx, PointerCast(cx, rval, llty));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue