diff options
| author | bors <bors@rust-lang.org> | 2013-09-01 22:35:45 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-09-01 22:35:45 -0700 |
| commit | 8f678ae688df430a44306bd171bccafaca97c398 (patch) | |
| tree | 330f005a94cf560fee4e915665af661de0b70d7c /src/libstd | |
| parent | 73a28e595c2aacf38c12a56807547e7cda6839ee (diff) | |
| parent | c4bb88364eaac3104271b42be15d64d704aee055 (diff) | |
| download | rust-8f678ae688df430a44306bd171bccafaca97c398.tar.gz rust-8f678ae688df430a44306bd171bccafaca97c398.zip | |
auto merge of #8928 : novalis/rust/fix-8898, r=thestinger
I think this fixes 8898. I'm a bit unsure about how slices and owned pointers to vectors-of-unit already worked, but since they were already working, I didn't mess with them.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/repr.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs index 3e2c5773acc..003dda294da 100644 --- a/src/libstd/repr.rs +++ b/src/libstd/repr.rs @@ -381,10 +381,11 @@ impl<'self> TyVisitor for ReprVisitor<'self> { } } - fn visit_evec_fixed(&mut self, _n: uint, sz: uint, _align: uint, + fn visit_evec_fixed(&mut self, n: uint, sz: uint, _align: uint, mtbl: uint, inner: *TyDesc) -> bool { + let assumed_size = if sz == 0 { n } else { sz }; do self.get::<()> |this, b| { - this.write_vec_range(mtbl, ptr::to_unsafe_ptr(b), sz, inner); + this.write_vec_range(mtbl, ptr::to_unsafe_ptr(b), assumed_size, inner); } } |
