提交 0f1f5e67 编写于 作者: B Brian Anderson

Create correct drop glue for istrs. Issue #855

上级 fd8ca2cf
......@@ -1426,6 +1426,10 @@ fn make_drop_glue(cx: &@block_ctxt, v0: ValueRef, t: ty::t) {
let rslt = iter_structural_ty(cx, v1, t, drop_ty);
maybe_free_ivec_heap_part(rslt.bcx, v1, tm.ty)
}
ty::ty_istr. {
maybe_free_ivec_heap_part(cx, v0,
ty::mk_mach(ccx.tcx, ast::ty_u8))
}
ty::ty_box(_) { decr_refcnt_maybe_free(cx, v0, v0, t) }
ty::ty_uniq(_) { trans_shared_free(cx, cx.build.Load(v0)) }
ty::ty_obj(_) {
......
......@@ -11,7 +11,13 @@ fn test_heap_lit() {
~"a big string";
}
fn test_heap_assign() {
let s: istr;
s = ~"AAAA";
}
fn main() {
test_stack_assign();
test_heap_lit();
test_heap_assign();
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册