Skip to content

Commit a35a378

Browse files
committed
codegen: Handle a few more cases, populate some mps structs
1 parent a0f1afa commit a35a378

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

generate/codegen/gen_function.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ func (f *Function) WriteGoCallCode(currentModule *modules.Module, cw *CodeWriter
177177
sb.WriteString(cw.IndentStr + fmt.Sprintf(" (*C.%s)(unsafe.Pointer(&%s))", tt.CName(), p.GoName()))
178178
case *typing.IDType:
179179
sb.WriteString(cw.IndentStr + fmt.Sprintf(" %s.Ptr()", p.GoName()))
180+
case *typing.ClassType, *typing.ProtocolType:
181+
sb.WriteString(cw.IndentStr + fmt.Sprintf(" unsafe.Pointer(&%s)", p.GoName()))
180182
default:
181183
sb.WriteString(cw.IndentStr + p.GoName())
182184
}

0 commit comments

Comments
 (0)