- Home /

This post has been wikified, any user with enough reputation can edit it.

# 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

Comment

### 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.