- Home /

# ExecutionEngineException: SIGILL

I'm using a recursive function in javascript, but when i use recursion it give me this error:

System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, System.Array destinationArray, Int32 destinationIndex, Int32 length) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Array.cs:991) System.Array.Copy (System.Array sourceArray, System.Array destinationArray, Int32 length) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Array.cs:936) New game.Add (Int32 m, Int32 n, System.Int32[,] matrix, Int32 player) (at Assets/New game.js:295) New game.AI_col (System.Int32[,] matrix_temp, Int32 level, Int32 player) (at Assets/New game.js:136) my code is: function AI_col(matrix_temp:int[,], level:int, player:int):int[]{ //just put zeros in the array var colonne_possibili:int[]; colonne_possibili = new int[colonne]; var j:int; for(j=0;j if(level==0){ //nothig }else{ for(n=0;n } return colonne_possibili;ExecutionEngineException: SIGILL

}

function Add(m:int,n:int,matrix:int[,],player:int):int[,]{ var matrix_temp:int[,]; matrix_temp = new int[righe,colonne]; System.Array.Copy (matrix, matrix_temp, matrix.GetLength(0)*matrix_temp.GetLength(1)); if(dimensioni==1){ for(m=righe-1;m>=0;m--){ if(matrix_temp[m,n]==0){ matrix_temp[m,n]=player; m=-1; //ottimizzazione } } } return matrix_temp; }

problem seem to be System.Array.Copy (matrix, matrix_temp, matrix.GetLength(0)*matrix_temp.GetLength(1)); so i thought about an overflow but it does recursion just 8 times so it has no sense, so my last idea is that I should allocate variables in a different way, but I don't know how, i used to use the same variables in function but that way the original array was overwritten so I found the system.array.copy method (it was few months ago so I can't remember exactely) thanks in advance

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

### Follow this Question

### Related Questions

More like a bulletin than chat box 0 Answers

Setting Scroll View Width GUILayout 1 Answer

Ragdoll Rigidbody Array? 1 Answer

Declaring and using array of arrays in Javascript 3 Answers

Calling random functions 4 Answers