Bug 13560 – Several functions in std.uni can violate memory safety
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-10-01T07:07:52Z
Last change time
2019-12-10T09:53:58Z
Assigned to
Dmitry Olshansky
Creator
Tomoya Tanjo
Comments
Comment #0 by ttanjo — 2014-10-01T07:07:52Z
In std/uni.d, there is a line with `@trusted:` in the line 6380.
But decodeGrapheme, byGrapheme and other functions should not be trusted because their memory safety depends on the static argument for them.
Furthermore, there are several functions and methods individually marked as trusted/safe after the line 6380.
Other functions after line 6380 seem to be accidentally marked as trusted.
We should remove such `@trusted:` and make each function safe or trusted after carefully checking its memory safety.
Comment #1 by dmitry.olsh — 2014-10-05T19:28:53Z
Once we have RCString, I'd gladly use it for Grapheme. Then Grapheme will be just an alias for RCString and all (hopefully) will be safe and efficient.
Still I'd accept any intermediate fix if provided.