]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: always use a Field for ODOTPTR expressions
authorMatthew Dempsky <mdempsky@google.com>
Sun, 27 Dec 2020 01:51:16 +0000 (17:51 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 28 Dec 2020 03:38:58 +0000 (03:38 +0000)
commita4f335f42033bc1ef9b948a9bff6f14aa6eb1aa8
treebf82587e5a0665741c765ad592bd883c3109fd21
parente4f293d85306cb89da3c134ce432e330e289447e
[dev.regabi] cmd/compile: always use a Field for ODOTPTR expressions

During walk, we create ODOTPTR expressions to access runtime struct
fields. But rather than using an actual Field for the selection, we
were just directly setting the ODOTPTR's Offset field.

This CL changes walk to create proper struct fields (albeit without
the rest of their enclosing struct type) and use them for creating the
ODOTPTR expressions.

Passes toolstash -cmp.

Change-Id: I08dbac3ed29141587feb0905d15adbcbcc4ca49e
Reviewed-on: https://go-review.googlesource.com/c/go/+/280432
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/walk/switch.go
src/cmd/compile/internal/walk/walk.go