From 5fb93258488c1b2083ea1042ee9674b842c29548 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 17 Jun 2011 16:49:04 -0700 Subject: rustc: Fix a bunch of memory management bugs relating to generic interior vectors. Uncomment all tests in lib-ivec. --- src/rt/rust_builtin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rt/rust_builtin.cpp') diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index afa022fe533..ca8f24a4227 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -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; -- cgit 1.4.1-3-g733a5