File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2752,7 +2752,7 @@ private P toUTFzImpl(P, S)(S str) @safe pure
27522752 // unreadable. Otherwise, it's definitely pointing to valid
27532753 // memory.
27542754 if ((cast (size_t )p & 3 ) && * p == ' \0 ' )
2755- return str.ptr ;
2755+ return & str[ 0 ] ;
27562756 }
27572757
27582758 return toUTFzImpl! (P, const (C)[])(cast (const (C)[])str);
@@ -2779,11 +2779,11 @@ private P toUTFzImpl(P, S)(S str) @safe pure
27792779 auto p = trustedPtrAdd(str);
27802780
27812781 if ((cast (size_t )p & 3 ) && * p == ' \0 ' )
2782- return str.ptr ;
2782+ return & str[ 0 ] ;
27832783 }
27842784
27852785 str ~= ' \0 ' ;
2786- return str.ptr ;
2786+ return & str[ 0 ] ;
27872787 }
27882788 // const(C)[] -> C* or immutable(C)* or
27892789 // C[] -> immutable(C)*
@@ -2811,7 +2811,7 @@ private P toUTFzImpl(P, S)(S str) @safe pure
28112811 retval.put(c);
28122812 retval.put(' \0 ' );
28132813
2814- return cast (P)retval.data.ptr;
2814+ return () @trusted { return cast (P)retval.data.ptr; } () ;
28152815}
28162816
28172817@safe pure unittest
You can’t perform that action at this time.
0 commit comments