Error On this code?

So, this is my code, and whenever I click play, the editor freezes. However, if I comment out the line "Debug.log (pos );", then it wouldn’t.
using UnityEngine;
using System.Collections;

public class SpawnChair : MonoBehaviour
{

  • public float radius;*

  • public int numForSpawn;*

  • public GameObject prefab;*

  • GameObject theObject;*

  • Vector2 pos = new Vector2[5];*

  • float x, y;*

  • void Awake ()*

  • {*

  •  for (int i = 0; i < numForSpawn; i++)*
    
  •  {*
    
  •  	do* 
    
  •  	{*
    
  •  		x = Random.Range (0, radius + 0.01f);*
    
  •  		y = Random.Range (0, radius + 0.01f);*
    

_ pos = new Vector2 (x, y);_
* Debug.Log (pos [0]);*
_ } while (Mathf.Sqrt (x * x + y * y) != radius);_

* theObject = Instantiate (prefab) as GameObject;*
_ theObject.transform.position = pos ;
* }
}
}*_

You loop until X and Y magically happen to both land on the surface of your circle ? This has a veeeeeery low chance of happening especially when you take into account the inaccuracy of floating point numbers. I’m pretty sure you are getting stuck inside this loop.

do 
{
    x = Random.Range (0, radius + 0.01f);
    y = Random.Range (0, radius + 0.01f);
    pos  *= new Vector2 (x, y);*

Debug.Log (pos [0]);
} while (Mathf.Sqrt (x * x + y * y) != radius);
Depending on what you want exactly, you should probably use
[Random.onUnitSphere][1] or otherwise modify your randomizing code so it always produces valid coordinates (randomize x and calculate y from there).
[1]: Unity - Scripting API: Random.onUnitSphere