Commit bbdf473
committed
Fix for issue #326.
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.1 parent a28f143 commit bbdf473
1 file changed
+27
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2156 | 2156 | | |
2157 | 2157 | | |
2158 | 2158 | | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
2159 | 2163 | | |
2160 | 2164 | | |
2161 | 2165 | | |
| |||
2178 | 2182 | | |
2179 | 2183 | | |
2180 | 2184 | | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
2181 | 2203 | | |
| 2204 | + | |
2182 | 2205 | | |
2183 | 2206 | | |
2184 | 2207 | | |
2185 | 2208 | | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
2186 | 2212 | | |
| 2213 | + | |
2187 | 2214 | | |
2188 | 2215 | | |
2189 | 2216 | | |
| |||
0 commit comments