We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a44c04 commit 7bce3b1Copy full SHA for 7bce3b1
src/array.c
@@ -441,6 +441,11 @@ JL_DLLEXPORT jl_value_t *jl_array_to_string(jl_array_t *a)
441
if (jl_is_string(o)) {
442
a->flags.isshared = 1;
443
*(size_t*)o = jl_array_len(a);
444
+ a->nrows = 0;
445
+#ifdef STORE_ARRAY_LEN
446
+ a->length = 0;
447
+#endif
448
+ a->maxsize = 0;
449
return o;
450
}
451
test/strings/basic.jl
@@ -810,3 +810,11 @@ let s = "∀x∃y", u = codeunits(s)
810
@test_throws ErrorException (u[1] = 0x00)
811
@test collect(u) == b"∀x∃y"
812
end
813
+
814
+# issue #24388
815
+let v = unsafe_wrap(Vector{UInt8}, "abc")
816
+ s = String(v)
817
+ @test_throws BoundsError v[1]
818
+ push!(v, UInt8('x'))
819
+ @test s == "abc"
820
+end
0 commit comments