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
The easiest fix is simply to not dereference the pointer. So do that,
and support KindFunc now that it'll work.
Reviewed-by: Keith Randall <firstname.lastname@example.org>
1 file changed