Explorar el Código

Fixed type recursion issue checking attributes in DoCEEmit

Brian Fiete hace 3 años
padre
commit
0e86b5c49d
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      IDEHelper/Compiler/BfModuleTypeUtils.cpp

+ 8 - 0
IDEHelper/Compiler/BfModuleTypeUtils.cpp

@@ -2820,6 +2820,14 @@ void BfModule::DoCEEmit(BfTypeInstance* typeInstance, bool& hadNewMembers, bool
 {
 	BfLogSysM("BfModule::DoCEEmit %p\n", typeInstance);
 
+	if (((typeInstance->IsInstanceOf(mCompiler->mValueTypeTypeDef))) ||
+		((typeInstance->IsInstanceOf(mCompiler->mEnumTypeDef))) ||
+		((typeInstance->IsInstanceOf(mCompiler->mAttributeTypeDef))))
+	{
+		// These are not allowed to emit
+		return;
+	}
+
 	CeEmitContext ceEmitContext;
 	ceEmitContext.mType = typeInstance;
 	ExecuteCEOnCompile(&ceEmitContext, typeInstance, BfCEOnCompileKind_TypeInit, underlyingTypeDeferred);