Thread overview
July 25
Is a dchar a signed 32-bit number? LDC seems to think so, as I spotted it in Compiler Explorer sign-extending from 32 to 64-bits for some very odd reason. Do we really want it to be signed? (Please answer ‘no’, as this could lead to some bugs, although the range of legitimate Unicode code points is quite limited, being only, what, 17 * 65536 roughly.)
July 26
The spec says they are unsigned, so if ldc is using sign extension, that is probably a bug.
July 27
On Wednesday, 26 July 2023 at 01:56:28 UTC, Richard (Rikki) Andrew Cattermole wrote:
> The spec says they are unsigned, so if ldc is using sign extension, that is probably a bug.

My fault, I reread the code and the sign-extension applies to something else, coincidentally right where I was looking at this. It uses signed 32-bit displacements in a case/switch table of offsets into the code segment, and that was what mislead me. It could have used unsigned displacements but then all the labels in the code would have to be above the reference base point, and this allows +/- offsets to anywhere. So my apologies.