Commit 9b9311f
committed
ssa: fix zero-value map indexing
Represent zero-value maps as null *runtime.Map pointers and avoid constant-extracting array elements from nil-backed values. This keeps zero-value map indexing on the normal load path and emits MapAccess1 with a nil map pointer instead of a zero-initialized hmap value.
Add a focused cl/_testlibgo/mapzero case covering the runtime output and the FileCheck expectation.
Signed-off-by: ZhouGuangyuan <[email protected]>1 parent b4d9167 commit 9b9311f
4 files changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | 287 | | |
291 | 288 | | |
292 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
0 commit comments