mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-20 06:43:14 +01:00
For a foreach (int i, dchar c; str) loop the compiler generates a delegate with a different type signature then the runtime uses. The runtime declares the parameters as void* and passes a pointer to a size_t variable for the index. The code generated by the compiler expects a ref int. This works on a little endian architecture, but on a big endian architecture the index is always 0. This fix changes the parameter type of the passed index to size_t and generates a cast to the type specified by the user.
160 KiB
160 KiB