From 8e8a28b23e96e71b2aa24a13aa1d2d6bb9a72378 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 17 Mar 2025 11:52:48 -0400 Subject: [PATCH] HasFlag behavior change --- IDEHelper/Compiler/BfModule.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index d5ae7189..8c385115 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -13809,6 +13809,9 @@ void BfModule::AggregateSplatIntoAddr(BfTypedValue typedValue, BfIRValue addrVal BfTypedValue BfModule::MakeAddressable(BfTypedValue typedVal, bool forceMutable, bool forceAddressable) { + if (!typedVal) + return typedVal; + bool wasReadOnly = typedVal.IsReadOnly(); if ((forceAddressable) || @@ -22567,7 +22570,7 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup, { BfIRValue thisValue = LoadValue(GetThis()).mValue; auto andResult = mBfIRBuilder->CreateAnd(thisValue, mCurMethodState->mLocals[1]->mValue); - auto toBool = mBfIRBuilder->CreateCmpNE(andResult, GetDefaultValue(mCurMethodState->mLocals[0]->mResolvedType)); + auto toBool = mBfIRBuilder->CreateCmpEQ(andResult, mCurMethodState->mLocals[1]->mValue); fromBool = mBfIRBuilder->CreateNumericCast(toBool, false, BfTypeCode_Boolean); } mBfIRBuilder->RestoreDebugLocation();