only if it is different from the one it is unassigned.
{
assignedInterval->assignedReg = regRec;
}
- else if (regRec->previousInterval != nullptr && regRec->previousInterval->assignedReg == regRec &&
+ else if (regRec->previousInterval != nullptr && regRec->previousInterval != assignedInterval &&
+ regRec->previousInterval->assignedReg == regRec &&
regRec->previousInterval->getNextRefPosition() != nullptr)
{
regRec->assignedInterval = regRec->previousInterval;