Sfoglia il codice sorgente

Aggregate fix for nullable casting

Brian Fiete 6 mesi fa
parent
commit
65a3bb2196
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      IDEHelper/Compiler/BfModuleTypeUtils.cpp

+ 1 - 0
IDEHelper/Compiler/BfModuleTypeUtils.cpp

@@ -14087,6 +14087,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
 		if (!typedVal.IsAddr())
 		if (!typedVal.IsAddr())
 		{
 		{
 			auto srcAlloca = CreateAllocaInst(fromNullableType);
 			auto srcAlloca = CreateAllocaInst(fromNullableType);
+			typedVal = LoadOrAggregateValue(typedVal);
 			mBfIRBuilder->CreateStore(typedVal.mValue, srcAlloca);
 			mBfIRBuilder->CreateStore(typedVal.mValue, srcAlloca);
 			srcPtr = srcAlloca;
 			srcPtr = srcAlloca;
 		}
 		}