From aed026f4fc35000b78dda1fca66ae06612e199f6 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 9 Oct 2020 14:10:53 -0700 Subject: [PATCH] Fixed array alloc bitcast in entry block --- IDEHelper/Compiler/BfModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 8aef0fff..ca106211 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/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);