1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed phi with StringView

This commit is contained in:
Brian Fiete 2020-12-31 06:25:48 -08:00
parent 706fe9e04b
commit 65c0f10cba

View file

@ -3686,13 +3686,17 @@ void BeMCContext::CreatePhiAssign(BeMCBlock* mcBlock, const BeMCOperand& testVal
checkInst->mArg0 = falseLabel; checkInst->mArg0 = falseLabel;
checkInst->mArg1.mCmpKind = BeModule::InvertCmp(checkInst->mArg1.mCmpKind); checkInst->mArg1.mCmpKind = BeModule::InvertCmp(checkInst->mArg1.mCmpKind);
AllocInst(BeMCInstKind_Mov, result, phiVal.mValue, checkIdx + 1); int insertIdx = checkIdx + 1;
AllocInst(BeMCInstKind_Br, prevDest, checkIdx + 2); SetAndRestoreValue<int*> prevInsertIdxRef(mInsertInstIdxRef, &insertIdx);
AllocInst(BeMCInstKind_Label, falseLabel, checkIdx + 3); CreateStore(BeMCInstKind_Mov, phiVal.mValue, OperandToAddr(result));
AllocInst(BeMCInstKind_Br, prevDest);
AllocInst(BeMCInstKind_Label, falseLabel);
} }
else else
{ {
AllocInst(BeMCInstKind_Mov, result, phiVal.mValue, checkIdx); int insertIdx = checkIdx;
SetAndRestoreValue<int*> prevInsertIdxRef(mInsertInstIdxRef, &insertIdx);
CreateStore(BeMCInstKind_Mov, phiVal.mValue, OperandToAddr(result));
} }
found = true; found = true;
@ -15790,7 +15794,7 @@ void BeMCContext::Generate(BeFunction* function)
mDbgPreferredRegs[32] = X64Reg_R8;*/ mDbgPreferredRegs[32] = X64Reg_R8;*/
//mDbgPreferredRegs[8] = X64Reg_RAX; //mDbgPreferredRegs[8] = X64Reg_RAX;
//mDebugging = (function->mName == "??$EmitNow@UInitialize@CoreEvents@Atma@bf@@@Emitter@Atma@bf@@QEAAXUInitialize@CoreEvents@Atma@bf@@@Z"); //mDebugging = (function->mName == "?Main@TestProgram@BeefTest@bf@@SATint@@PEAV?$Array1@PEAVString@System@bf@@@System@3@@Z");
// || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ"); // || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ");
// || (function->mName == "?Hey@Blurg@bf@@SAXXZ") // || (function->mName == "?Hey@Blurg@bf@@SAXXZ")
// ; // ;