diff --git a/IDEHelper/Compiler/BfIRBuilder.cpp b/IDEHelper/Compiler/BfIRBuilder.cpp index 262e99f1..250f54d3 100644 --- a/IDEHelper/Compiler/BfIRBuilder.cpp +++ b/IDEHelper/Compiler/BfIRBuilder.cpp @@ -664,6 +664,8 @@ bool BfIRConstHolder::IsConstValue(BfIRValue value) if (constant->mConstType == BfConstType_GlobalVar) return false; + if (constant->mConstType == BfConstType_Undef) + return false; return true; } diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index c2f2561d..e9879a44 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -15752,7 +15752,7 @@ BfTypedValue BfModule::ReferenceStaticField(BfFieldInstance* fieldInstance) { // Just fake it for the extern and unspecialized modules // We can't do this for compilation because unreified methods with default params need to get actual global variable refs - return BfTypedValue(mBfIRBuilder->CreateConstNull(), fieldInstance->GetResolvedType(), true); + return BfTypedValue(mBfIRBuilder->CreateUndefValue(mBfIRBuilder->GetPrimitiveType(BfTypeCode_NullPtr)), fieldInstance->GetResolvedType(), true); } BfIRValue* globalValuePtr = NULL;