Ver Fonte

Ensure global function pointer init is cast.

Brucey há 5 meses atrás
pai
commit
6281ec166c
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      ctranslator.bmx

+ 2 - 2
ctranslator.bmx

@@ -1011,9 +1011,9 @@ t:+"NULLNULLNULL"
 				If gdecl.init Then
 				If gdecl.init Then
 					If TFunctionPtrType(gdecl.ty) Then
 					If TFunctionPtrType(gdecl.ty) Then
 						If TInvokeExpr(gdecl.init) And Not TInvokeExpr(gdecl.init).invokedWithBraces Then
 						If TInvokeExpr(gdecl.init) And Not TInvokeExpr(gdecl.init).invokedWithBraces Then
-							glob :+ TInvokeExpr(gdecl.init).decl.munged
+							glob :+ TransCast(TFunctionPtrType(gdecl.ty)) + TInvokeExpr(gdecl.init).decl.munged
 						Else
 						Else
-							glob :+ gdecl.init.Trans()
+							glob :+ TransCast(TFunctionPtrType(gdecl.ty)) + gdecl.init.Trans()
 						End If
 						End If
 					Else If Not TConstExpr(gdecl.init) And Not (gdecl.attrs & DECL_INITONLY) Then
 					Else If Not TConstExpr(gdecl.init) And Not (gdecl.attrs & DECL_INITONLY) Then
 						' for non const, we need to add an initialiser
 						' for non const, we need to add an initialiser