Browse Source

Throw error on illegal aliases

Brian Fiete 4 years ago
parent
commit
bc5668ada5
2 changed files with 10 additions and 1 deletions
  1. 9 0
      IDEHelper/Compiler/BfModuleTypeUtils.cpp
  2. 1 1
      IDEHelper/WinDebugger.cpp

+ 9 - 0
IDEHelper/Compiler/BfModuleTypeUtils.cpp

@@ -1103,6 +1103,15 @@ void BfModule::PopulateType(BfType* resolvedTypeRef, BfPopulateType populateType
 			if (typeAliasDecl->mAliasToType != NULL)
 				aliasToType = ResolveTypeRef(typeAliasDecl->mAliasToType, BfPopulateType_IdentityNoRemapAlias);				
 		}
+
+		if (aliasToType != NULL)
+		{
+			if (aliasToType->IsConstExprValue())
+			{
+				Fail(StrFormat("Illegal alias to type '%s'", TypeToString(aliasToType).c_str()), typeAlias->mTypeDef->GetRefNode());
+				aliasToType = NULL;
+			}
+		}
 		
 		if (aliasToType != NULL)
 		{

+ 1 - 1
IDEHelper/WinDebugger.cpp

@@ -2731,7 +2731,7 @@ bool WinDebugger::DoUpdate()
 
 						if (!handled)
 						{
-							OutputMessage(StrFormat("Skipping first chance exception %08Xd at address %@ in thread %d\n", exceptionRecord->ExceptionCode, exceptionRecord->ExceptionAddress, threadInfo->mThreadId));
+							OutputMessage(StrFormat("Skipping first chance exception %08X at address %@ in thread %d\n", exceptionRecord->ExceptionCode, exceptionRecord->ExceptionAddress, threadInfo->mThreadId));
 							::ContinueDebugEvent(mDebuggerWaitingThread->mProcessId, mDebuggerWaitingThread->mThreadId, DBG_EXCEPTION_NOT_HANDLED);
 							mIsDebuggerWaiting = false;
 						}