diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-07-27 21:46:14 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-07-27 21:46:14 +0200 |
| commit | 73e8e49897c2a92d5908e89f392bd40386219aab (patch) | |
| tree | 075390c22484145832d04b0e2f7f095dc8e58ec9 /src/rt/rust_builtin.cpp | |
| parent | 0186176ae989cc5ccce1cf90322c567eee084dbf (diff) | |
| download | rust-73e8e49897c2a92d5908e89f392bd40386219aab.tar.gz rust-73e8e49897c2a92d5908e89f392bd40386219aab.zip | |
More thorough check for interior-ness in str_from_ivec
Closes #750
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 6ba749b0d5c..eefc6dac8ce 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -312,8 +312,9 @@ str_byte_len(rust_task *task, rust_str *s) extern "C" CDECL rust_str * str_from_ivec(rust_task *task, rust_ivec *v) { - uintptr_t fill = v->fill ? v->fill : v->payload.ptr->fill; - void *data = v->fill ? v->payload.data : v->payload.ptr->data; + bool is_interior = v->fill || !v->payload.ptr; + uintptr_t fill = is_interior ? v->fill : v->payload.ptr->fill; + void *data = is_interior ? v->payload.data : v->payload.ptr->data; rust_str *st = vec_alloc_with_data(task, |
