How to test if a string is pointing into read-only memory?

Kagamin spam at here.lot
Tue Oct 12 19:25:42 UTC 2021


On Tuesday, 12 October 2021 at 08:19:01 UTC, jfondren wrote:
> and string literals weren't reliably in read-only memory as 
> recently as early 2017: 
> https://github.com/dlang/dmd/pull/6546#issuecomment-280612721

Sometimes sections have defined symbols for start and end, you 
can check if the string is in rdata section. On windows you can 
test it generically with IsBadWritePtr function.


More information about the Digitalmars-d-learn mailing list