Skip to content

Instantly share code, notes, and snippets.

@michaelbartnett
Created October 24, 2015 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelbartnett/dc97c7f34ef6df4ef840 to your computer and use it in GitHub Desktop.
Save michaelbartnett/dc97c7f34ef6df4ef840 to your computer and use it in GitHub Desktop.
Unity3D compiler bug, infinite loop in case jump
/* 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