unity crash when i change a variable affectation

hi This function below is ok but if I change the affected value in the if

`poids = 15;`

this isnt working, No exeption, nothing but unity not responding seems to be crash. nothing to do exept kill the process. Do you know why?

private static function calculerValeurHeuristique(node:Node, goal:Vector3):float   
{

    var poids:float = 0;

    if (Global.getInstance().isValidLocation(node.position) == false)
    {
        poids = 3;  
    }

    poids += Vector3.Distance(node.position,goal) + 1;
    return poids;   
}

Ok I change a few things and it was probably just an infinit loop. My bad