gocore: fix direct interface handling

An interface that contains a pointer-shaped type doesn't need to
introduce a new level of indirection, and is therefore called a "direct"
interface. The implementation of typeObject for direct interfaces was a
little over-eager, and tried to dereference that pointer before adding
it to the work queue.

That caused two problems. First, dereferencing a KindFunc is
meaningless: Funcs are pointers to closures, *not* the closures
themselves. Second, if it had failed to find the type of the interface
contents, notably because it had recursed through a struct type with no
DWARF, it would dereference unsafe.Pointer, end up with no type, and
crash.

The easiest fix is simply to not dereference the pointer. So do that,
and support KindFunc now that it'll work.

Change-Id: Ica03bd7155bea94d95a15807a977520958954b1c
Reviewed-on: https://go-review.googlesource.com/102195
Reviewed-by: Keith Randall <khr@golang.org>
1 file changed