gollvm: handle more circular function type conversions

Handle another case of circular function types in
convertForAssignment, where LHS and RHS are two different
representation of the same circular function type, i.e.
LHS is *function, whereas RHS is *CFT.

This case is triggered with code like

type fs []f
type p struct { t fs }
type f func(*p) bool

func (s *fs) pop() (i f) {
	i = (*s)[0]
	return i

Change-Id: I5215058f83e25519ee2f32c8bad31055e8d18458
Reviewed-on: https://go-review.googlesource.com/122755
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/bridge/go-llvm-materialize.cpp b/bridge/go-llvm-materialize.cpp
index 0e96eaa..3a5d9d1 100644
--- a/bridge/go-llvm-materialize.cpp
+++ b/bridge/go-llvm-materialize.cpp
@@ -1447,8 +1447,9 @@
   // Case 2: handle circular function types.
   bool dstCircFunc = isCircularFunctionType(dstToType);
+  bool srcCircFunc = isCircularFunctionType(srcType);
   bool srcFuncPtr = isPtrToFuncType(srcType);
-  if ((srcPtrToFD || srcFuncPtr) && dstCircFunc) {
+  if ((srcPtrToFD || srcFuncPtr || srcCircFunc) && dstCircFunc) {
     std::string tag(namegen("cast"));
     llvm::Value *bitcast = builder->CreateBitCast(srcVal, dstToType, tag);
     return bitcast;