internal/gocore: handle moving direct interface flag from kind to tflag Change-Id: I2b8cf8030c7041bfef22a57adf49da2e5e1ebf8a Reviewed-on: https://go-review.googlesource.com/c/debug/+/682075 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/internal/gocore/type.go b/internal/gocore/type.go index 7bab5c5..c384800 100644 --- a/internal/gocore/type.go +++ b/internal/gocore/type.go
@@ -662,6 +662,11 @@ // ifaceIndir reports whether t is stored indirectly in an interface value. func ifaceIndir(t core.Address, p *Process) bool { typr := p.findRuntimeType(t) + if tflagDirectIface, ok := p.rtConsts.find("internal/abi.TFlagDirectIface"); ok { + // 1.26 and later, direct bit stored in tflags + return typr.TFlag()&uint8(tflagDirectIface) != 0 + } + // 1.25 and earlier, direct bit stored in kind field return typr.Kind_()&uint8(p.rtConsts.get("internal/abi.KindDirectIface")) == 0 }