1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Fixed invalid lifetimeStart emission with dynLife vregs

This commit is contained in:
Brian Fiete 2021-11-05 06:57:16 -07:00
parent fd08367e2b
commit d10951527a

View file

@ -16748,8 +16748,17 @@ void BeMCContext::Generate(BeFunction* function)
auto castedInst = (BeLifetimeEndInst*)inst;
auto mcPtr = GetOperand(castedInst->mPtr, false, true);
if (mcPtr)
{
auto vregInfo = GetVRegInfo(mcPtr);
if ((vregInfo != NULL) && (vregInfo->mHasDynLife))
{
// This alloca had an assignment (ie: `mov vregX, [RBP+homeSize0]`) so it must be defined at the mov
// This may indicate incorrectly generated code where we thought an alloca would be in the head but it isn't
}
else
AllocInst(BeMCInstKind_LifetimeStart, mcPtr);
}
}
break;
case BeLifetimeExtendInst::TypeId:
{