From 30dd32d4db0834a9bb965cfceaee3211f09a5344 Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Mon, 18 Jun 2012 12:50:09 -0700 Subject: Fix generation of str/@. Closes #2638. --- src/rt/rust_upcall.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/rt') diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index ea938d386f4..3803f60c045 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -373,8 +373,9 @@ upcall_s_str_new_shared(s_str_new_shared_args *args) { size_t str_fill = args->len + 1; size_t str_alloc = str_fill; args->retval = (rust_opaque_box *) - task->boxed.malloc(&str_body_tydesc, str_fill); - rust_str *str = (rust_str *)box_body(args->retval); + task->boxed.malloc(&str_body_tydesc, + str_fill + sizeof(rust_vec)); + rust_str *str = (rust_str *)args->retval; str->body.fill = str_fill; str->body.alloc = str_alloc; memcpy(&str->body.data, args->cstr, args->len); -- cgit 1.4.1-3-g733a5