Commit 9372173
committed
[IRGen] Cast fixed-size opaque globals.
In #66560 , a bug in the lowering of
`global_addr` was fixed. Part of that fix was to postpone mapping the
type of the global into context until getting the address of the global
and projecting the buffer for the out-of-line value; at that point, the
type is mapped into context and the address is cast.
It introduced an issue for fixed-size globals, however: the type of such
globals was not mapped into context; the result was that the lowered
value set for the corresponding SIL value would have the wrong type.
Fix that by extracting the code which mapped the type into context and
cast the address to the appropriate lowered type into a lambda and call
that lambda both in both the fixed-size (newly) and non-fixed-size (as
before) cases.
rdar://1140137091 parent a189be3 commit 9372173
File tree
2 files changed
+25
-9
lines changed- lib/IRGen
- validation-test/IRGen
2 files changed
+25
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2958 | 2958 | | |
2959 | 2959 | | |
2960 | 2960 | | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
2961 | 2973 | | |
2962 | 2974 | | |
2963 | 2975 | | |
| 2976 | + | |
2964 | 2977 | | |
2965 | 2978 | | |
2966 | 2979 | | |
2967 | 2980 | | |
2968 | 2981 | | |
2969 | 2982 | | |
2970 | 2983 | | |
2971 | | - | |
2972 | | - | |
2973 | | - | |
2974 | | - | |
2975 | | - | |
2976 | | - | |
2977 | | - | |
2978 | | - | |
2979 | | - | |
| 2984 | + | |
2980 | 2985 | | |
2981 | 2986 | | |
2982 | 2987 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments