diff options
| author | Michael Sullivan <sully@msully.net> | 2012-06-26 12:47:06 -0700 |
|---|---|---|
| committer | Michael Sullivan <sully@msully.net> | 2012-06-26 14:05:43 -0700 |
| commit | 51468b65a48e7e897ff7ac080c33efb7b5ce289d (patch) | |
| tree | d64a9c0a6dd323674bcfa17fa8f9b5686bd270d0 /src/rustc | |
| parent | f17ca3f73e8e6196a7549ae0df721828a3dfd262 (diff) | |
| download | rust-51468b65a48e7e897ff7ac080c33efb7b5ce289d.tar.gz rust-51468b65a48e7e897ff7ac080c33efb7b5ce289d.zip | |
Properly cleanup slice literals. Closes #2705.
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/middle/trans/tvec.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rustc/middle/trans/tvec.rs b/src/rustc/middle/trans/tvec.rs index 4a471bd0059..58d415ad266 100644 --- a/src/rustc/middle/trans/tvec.rs +++ b/src/rustc/middle/trans/tvec.rs @@ -152,8 +152,15 @@ fn trans_evec(bcx: block, args: [@ast::expr]/~, } ast::vstore_slice(_) { let n = vec::len(args); + // Make a fake type to use for the cleanup + let ty = ty::mk_evec(bcx.tcx(), + {ty: unit_ty, mutbl: ast::m_mutbl}, + ty::vstore_fixed(n)); + let n = C_uint(ccx, n); let vp = base::arrayalloca(bcx, llunitty, n); + add_clean(bcx, vp, ty); + let len = Mul(bcx, n, unit_sz); let p = base::alloca(bcx, T_struct([T_ptr(llunitty), |
