Created
October 24, 2015 22:23
-
-
Save michaelbartnett/dc97c7f34ef6df4ef840 to your computer and use it in GitHub Desktop.
Unity3D compiler bug, infinite loop in case jump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* in switch statement: */ | |
case GameState.Finished: | |
playerFinished = true; | |
goto case GameState.Quitting; | |
case GameState.OutOfTime: | |
case GameState.Died: | |
case GameState.Quitting: | |
// etc. | |
/* This hangs the game. | |
Look at it in assembly browser...*/ | |
/* ummmmm wat */ | |
// loop start (head: IL_01f10) | |
IL_01f0: ldc.i4.1 | |
IL_01f1: stloc.1 | |
IL_01f2: br IL_01f0 | |
// end loop | |
/* show C# version, WTF */ | |
case GameState.Finished: | |
goto IL_1FO; | |
while (true) { | |
IL_1F0: | |
goto IL_1F0; | |
} | |
case GameState.OutOfTime: | |
case GameState.Died: | |
case GameState.Quitting: { | |
// etc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment