Check which slots we have when copying function.

This commit is contained in:
Jean-Philip Desjardins 2022-12-01 11:29:42 -05:00
parent 638ac5797b
commit 55f24a1ee1

View file

@ -446,15 +446,21 @@ void CBasicBlock::CopyFunctionFrom(const std::shared_ptr<CBasicBlock>& other)
#ifdef _DEBUG
std::copy(std::begin(other->m_linkBlock), std::end(other->m_linkBlock), m_linkBlock);
#endif
if(
HasLinkSlot(LINK_SLOT_NEXT)
#ifdef _DEBUG
if(m_linkBlock[LINK_SLOT_NEXT])
&& m_linkBlock[LINK_SLOT_NEXT]
#endif
)
{
UnlinkBlock(LINK_SLOT_NEXT);
}
if(
HasLinkSlot(LINK_SLOT_BRANCH)
#ifdef _DEBUG
if(m_linkBlock[LINK_SLOT_BRANCH])
&& m_linkBlock[LINK_SLOT_BRANCH]
#endif
)
{
UnlinkBlock(LINK_SLOT_BRANCH);
}