-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String
constructor on a view
can mutate parent
#54156
Comments
I believe this is intended see also: #32528 |
The issue is that |
In older versions, the view function also enforced a copy, which seems awkward to expect there. We should possibly check though that the truncation of the Memory object only applies if it is backed by a String (and doesn't make a copy)? |
Maybe the |
Maybe #53896 should be reverted / rethought in light of this. |
We also possibly should not unsafely mutate this Memory in this case. That is somewhat more of an Array feature anyways that you should possibly lose when accessing Memory directly |
If I understand: Lines 196 to 207 in c38e7cd
String required to always be null terminated?
|
Fixed by #54927 |
This has happened since #53896
Here is a MWE.
I expected
a
to not be changed.This is causing issues in JuliaWeb/HTTP.jl#1166
And I am also using
String(view(
in https://github.com/JuliaIO/ZipArchives.jl/blob/5bacade2f71e0c28e2aeba09d21a665ecad131cd/src/reader.jl#L106The text was updated successfully, but these errors were encountered: