Fix UB: Destoyed task is modified.

After destruction, task is no longer used, so updating its values is worthless.
This commit is contained in:
gAlfonso-bit authored and huderlem committed 2021-05-15 14:35:32 -05:00
1 parent f62b42eb59
commit ab8318cc79
1 file changed
+3
+3
View File
@@ -4328,7 +4328,10 @@ static bool8 Phase2_FrontierSquaresScroll_Func5(struct Task *task)
BlendPalettes(PALETTES_ALL, 0x10, 0);
DestroyTask(FindTaskIdByFunc(task->func));
#ifndef UBFIX
task->tState++; // UB: changing value of a destroyed task
#endif
return FALSE;
}