2
0
Эх сурвалжийг харах

Fixed array alloc bitcast in entry block

Brian Fiete 5 жил өмнө
parent
commit
aed026f4fc

+ 2 - 2
IDEHelper/Compiler/BfModule.cpp

@@ -8415,10 +8415,10 @@ BfIRValue BfModule::AllocFromType(BfType* type, const BfAllocTarget& allocTarget
 					if (!isDynAlloc)
 						mBfIRBuilder->ClearDebugLocation(allocaInst);
 					mBfIRBuilder->SetAllocaAlignment(allocaInst, allocAlign);
-					auto typedVal = BfTypedValue(mBfIRBuilder->CreateBitCast(allocaInst, mBfIRBuilder->MapType(arrayType)), arrayType);
-					mBfIRBuilder->ClearDebugLocation_Last();
 					if (!isDynAlloc)
 						mBfIRBuilder->SetInsertPoint(prevBlock);
+					auto typedVal = BfTypedValue(mBfIRBuilder->CreateBitCast(allocaInst, mBfIRBuilder->MapType(arrayType)), arrayType);
+					mBfIRBuilder->ClearDebugLocation_Last();
 					if (!noDtorCall)
 						AddStackAlloc(typedVal, arraySize, NULL, scopeData, false, true);
 					InitTypeInst(typedVal, scopeData, zeroMemory, sizeValue);