diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-07-19 16:55:09 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-07-19 16:55:45 -0700 |
| commit | 652214d7f90516fd77394fddd65cda69d8861e58 (patch) | |
| tree | d85ff2477e092812b07238c33ff70deaedc8b5da /src/rt/rust_builtin.cpp | |
| parent | 19a17b3d1d0d25155c8bd11c73bf88238f9bd180 (diff) | |
| download | rust-652214d7f90516fd77394fddd65cda69d8861e58.tar.gz rust-652214d7f90516fd77394fddd65cda69d8861e58.zip | |
Fix calculation of sizeof boxed ivec of str in rt. Closes #712
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index df7b1cfc6d3..e434138f102 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -608,8 +608,12 @@ rust_list_files_ivec(rust_task *task, rust_str *path) { closedir(dirp); } #endif + size_t str_ivec_sz = + sizeof(size_t) // fill + + sizeof(size_t) // alloc + + sizeof(rust_str *) * 4; // payload rust_box *box = (rust_box *)task->malloc(sizeof(rust_box) + - sizeof(rust_ivec)); + str_ivec_sz); box->ref_count = 1; rust_ivec *iv = (rust_ivec *)&box->data; iv->fill = 0; |
