فهرست منبع

Fixed midcompile rebuild for deleted dependent types

Brian Fiete 1 سال پیش
والد
کامیت
04f1802303
1فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 10 0
      IDEHelper/Compiler/BfContext.cpp

+ 10 - 0
IDEHelper/Compiler/BfContext.cpp

@@ -1974,8 +1974,18 @@ void BfContext::DeleteType(BfType* type, bool deferDepRebuilds)
 
 
 		for (auto dependentType : rebuildTypeQueue)
 		for (auto dependentType : rebuildTypeQueue)
 		{
 		{
+			auto dependentTypeInst = dependentType->ToTypeInstance();
+
+			// This guards against recompile loops
 			if (CanRebuild(dependentType))
 			if (CanRebuild(dependentType))
+			{
 				RebuildType(dependentType);
 				RebuildType(dependentType);
+			}
+			else if (dependentTypeInst != NULL)
+			{
+				// This keeps us from crashing from accessing deleted types on subsequent compiles
+				mFailTypes.TryAdd(dependentTypeInst, BfFailKind_Normal);
+			}
 		}
 		}
 	}
 	}
 }
 }