From 18208cb95816bbfbe32f93d5352e441ffad70dcd Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 20 Jan 2021 07:43:17 -0800 Subject: [PATCH] Fixed ref autoprop --- IDEHelper/Compiler/BfModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index dad44a96..4685784c 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -19491,7 +19491,8 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup) lookupValue = BfTypedValue(mBfIRBuilder->CreateInBoundsGEP(GetThis().mValue, 0, fieldInstance->mDataIdx), fieldInstance->mResolvedType, true); else lookupValue = ExtractValue(GetThis(), fieldInstance, fieldInstance->mDataIdx); - lookupValue = LoadOrAggregateValue(lookupValue); + if (!methodInstance->mReturnType->IsRef()) + lookupValue = LoadOrAggregateValue(lookupValue); CreateReturn(lookupValue.mValue); EmitLifetimeEnds(&mCurMethodState->mHeadScope); }