fix Issue 15672 - Casting from void[] to T[] is erroneously considere…#5876
fix Issue 15672 - Casting from void[] to T[] is erroneously considere…#5876andralex merged 1 commit intodlang:masterfrom
Conversation
fc907f8 to
f3e50be
Compare
|
LGTM BTW, with all those |
|
Blocked by dlang/phobos#4438 |
|
When all the safety fixed are in, I'll review the spec and make sure it is congruent. |
|
Actually this is excessive. Casting from |
Surprisingly, it is not, as the bugzilla issue shows. The problem comes from an array of pointers being cast to void[], then the void[] is cast to int[], then ints are stored there, then the original array of pointers now has arbitrary pointers in it. |
|
blurgh thx |
|
Auto-merge toggled on |
The following DMD PRs added more rigorous safety checks directly affecting this project: * dlang/dmd#5852 (fix Issue 15399 - unaligned pointers are not `@safe`) - triggered at line: https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/emitter.d#L1011 * dlang/dmd#5940 (Unions may break immutability / unions with pointers are un-`@safe` ) - triggered at line: https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/event.d#L230 * dlang/dmd#5876 (Casting from `void[]` to `T[]` is erroneously considered `@safe`) - triggered at line: https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/loader.d#L186 * dlang/dmd#5860 (array.ptr in @safe code may point past end of array) - triggered at line: https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/zerostring.d#L35
The following DMD PRs added more rigorous safety checks directly affecting this project: * dlang/dmd#5852 (fix Issue 15399 - unaligned pointers are not `@safe`) - triggered at line: https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/emitter.d#L1011 * dlang/dmd#5940 (Unions may break immutability / unions with pointers are un-`@safe` ) - triggered at line: https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/event.d#L230 * dlang/dmd#5876 (Casting from `void[]` to `T[]` is erroneously considered `@safe`) - triggered at line: https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/loader.d#L186 * dlang/dmd#5860 (array.ptr in @safe code may point past end of array) - triggered at line: https://github.com/kiith-sa/D-YAML/blob/v0.5.3/source/dyaml/zerostring.d#L35
…d @safe
https://issues.dlang.org/show_bug.cgi?id=15672