Skip to content

Commit 602ce78

Browse files
committed
---
yaml --- r: 4185 b: refs/heads/master c: 73e8e49 h: refs/heads/master i: 4183: 9d7df72 v: v3
1 parent bcb72f3 commit 602ce78

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 0186176ae989cc5ccce1cf90322c567eee084dbf
2+
refs/heads/master: 73e8e49897c2a92d5908e89f392bd40386219aab

trunk/src/rt/rust_builtin.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,9 @@ str_byte_len(rust_task *task, rust_str *s)
312312
extern "C" CDECL rust_str *
313313
str_from_ivec(rust_task *task, rust_ivec *v)
314314
{
315-
uintptr_t fill = v->fill ? v->fill : v->payload.ptr->fill;
316-
void *data = v->fill ? v->payload.data : v->payload.ptr->data;
315+
bool is_interior = v->fill || !v->payload.ptr;
316+
uintptr_t fill = is_interior ? v->fill : v->payload.ptr->fill;
317+
void *data = is_interior ? v->payload.data : v->payload.ptr->data;
317318

318319
rust_str *st =
319320
vec_alloc_with_data(task,

0 commit comments

Comments
 (0)