More thorough check for interior-ness in str_from_ivec

Closes #750
This commit is contained in:
Marijn Haverbeke 2011-07-27 21:46:14 +02:00
parent 0186176ae9
commit 73e8e49897

View File

@ -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,