Skip to content

Commit 10608f7

Browse files
committed
---
yaml --- r: 5391 b: refs/heads/master c: d607316 h: refs/heads/master i: 5389: fb3f12d 5387: 516960e 5383: ad83070 5375: 83e78ff v: v3
1 parent a3d0517 commit 10608f7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 78147452b8c589edfae72ab6a17e71c25adc9f8f
2+
refs/heads/master: d607316b2f116372814a1e7b379b970071e21e00

trunk/src/comp/middle/trans.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,13 +837,17 @@ fn trans_malloc_boxed_raw(cx: @block_ctxt, t: ty::t) -> result {
837837
// wants.
838838
// FIXME: Could avoid this check with a postcondition on mk_imm_box?
839839
// (requires Issue #586)
840-
let ccx = bcx_ccx(cx);
841-
let sp = cx.sp;
840+
let ccx = bcx_ccx(bcx);
841+
let sp = bcx.sp;
842842
check (type_has_static_size(ccx, box_ptr));
843843
let llty = type_of(ccx, sp, box_ptr);
844844

845-
let tydesc = C_null(T_ptr(ccx.tydesc_type));
846-
let rval = Call(cx, ccx.upcalls.malloc, [cx.fcx.lltaskptr, llsz, tydesc]);
845+
let ti = none;
846+
let tydesc_result = get_tydesc(bcx, t, true, tps_normal, ti);
847+
let lltydesc = tydesc_result.result.val; bcx = tydesc_result.result.bcx;
848+
849+
let rval = Call(cx, ccx.upcalls.malloc,
850+
[cx.fcx.lltaskptr, llsz, lltydesc]);
847851
ret rslt(cx, PointerCast(cx, rval, llty));
848852
}
849853

0 commit comments

Comments
 (0)