@trusted assumptions about @safe code

Arine arine1283798123 at gmail.com
Tue May 26 01:01:59 UTC 2020


On Tuesday, 26 May 2020 at 00:57:52 UTC, Arine wrote:
>      char f(string s) @trusted
>      {
>          {
>              immutable(char)* c = s.ptrl
>              writeln(g(* cast(size_t*) &c));
>              // var c invalidated by above function, don't use 
> after this line
>          }
>          return s[0];
>      }

Ops, even that would still need a size check as well.


More information about the Digitalmars-d mailing list