Skip to content

Commit fdf2eaa

Browse files
committed
Divide vec fill by element size when reporting vec len.
1 parent 0fe1508 commit fdf2eaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rt/rust_builtin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ vec_buf(rust_task *task, type_desc *ty, rust_vec *v)
119119
extern "C" CDECL size_t
120120
vec_len(rust_task *task, type_desc *ty, rust_vec *v)
121121
{
122-
return v->fill;
122+
return v->fill / ty->size;
123123
}
124124

125125
//

0 commit comments

Comments
 (0)