rustc: Fix a bunch of memory management bugs relating to generic interior vectors. Uncomment all tests in lib-ivec.

This commit is contained in:
Patrick Walton
2011-06-17 16:49:04 -07:00
parent 68122edac3
commit 5fb9325848
3 changed files with 110 additions and 12 deletions

View File

@@ -682,7 +682,7 @@ ivec_copy_from_buf(rust_task *task, type_desc *ty, rust_ivec *v, void *ptr,
ivec_reserve(task, ty, v, count);
size_t new_size = count * ty->size;
if (v->fill) {
if (v->fill || !v->payload.ptr) {
// On stack.
memmove(v->payload.data, ptr, new_size);
v->fill = new_size;