Bläddra i källkod

Regression. Function Pointers require scope set before semanting.

woollybah 11 år sedan
förälder
incheckning
494a7bb1a6
1 ändrade filer med 11 tillägg och 3 borttagningar
  1. 11 3
      decl.bmx

+ 11 - 3
decl.bmx

@@ -251,19 +251,27 @@ Type TValDecl Extends TDecl
 			' ensure to set the scope for a function pointer array before semanting
 			If TArrayType(declTy) And TFunctionPtrType(TArrayType(declTy).elemType) Then
 				If Not TFunctionPtrType(TArrayType(declTy).elemType).func.scope Then
-					TFunctionPtrType(TArrayType(declTy).elemType).func.scope = scope
+					If scope Then
+						TFunctionPtrType(TArrayType(declTy).elemType).func.scope = scope
+					Else
+						TFunctionPtrType(TArrayType(declTy).elemType).func.scope = _env
+					End If
 				End If
 			End If
 
 			' pass the scope into the function ptr
 			If TFunctionPtrType(declTy) Then
 				If Not TFunctionPtrType(declTy).func.scope Then
-					TFunctionPtrType(declTy).func.scope = scope
+					If scope Then
+						TFunctionPtrType(declTy).func.scope = scope
+					Else
+						TFunctionPtrType(declTy).func.scope = _env
+					End If
 				End If
 			End If
 			
 			ty=declTy.Semant()
-			
+
 			If Not deferInit Then
 				SemantInit()
 			End If