diff --git a/IDEHelper/Backend/BeIRCodeGen.cpp b/IDEHelper/Backend/BeIRCodeGen.cpp index 58ac930d..eaf5777e 100644 --- a/IDEHelper/Backend/BeIRCodeGen.cpp +++ b/IDEHelper/Backend/BeIRCodeGen.cpp @@ -3448,6 +3448,8 @@ void BeIRCodeGen::HandleNextCmd() CMD_PARAM(bool, alwaysPreserve); CMD_PARAM(int, flags); + BF_ASSERT(type != NULL); + auto dbgFunc = (BeDbgFunction*)scope; auto dbgVar = mBeModule->mOwnedValues.Alloc(); @@ -3498,6 +3500,8 @@ void BeIRCodeGen::HandleNextCmd() CMD_PARAM(BeMDNode*, type); CMD_PARAM(int, initType); + BF_ASSERT(type != NULL); + auto dbgVar = mBeModule->mOwnedValues.Alloc(); dbgVar->mName = name; dbgVar->mType = type; diff --git a/IDEHelper/Compiler/BfIRBuilder.cpp b/IDEHelper/Compiler/BfIRBuilder.cpp index fae50f2d..3e4e75bb 100644 --- a/IDEHelper/Compiler/BfIRBuilder.cpp +++ b/IDEHelper/Compiler/BfIRBuilder.cpp @@ -2720,7 +2720,7 @@ public: #endif void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine) -{ +{ auto populateModule = mModule->mContext->mUnreifiedModule; auto typeInstance = type->ToTypeInstance(); if ((typeInstance != NULL) && (typeInstance->mModule != NULL)) @@ -3108,6 +3108,12 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine) } return; } + else + { + irType = GetPrimitiveType(BfTypeCode_None); + if (wantDIData) + diType = DbgCreateBasicType("void", 0, 0, llvm::dwarf::DW_ATE_address); + } if (irType) SetType(type, irType);