Page 1 of 1

ChucK: crash without reason

Posted: Mon Jul 03, 2006 12:33 pm
by ^rooker
[PROBLEM]
I wrote a small ChucK program which does some sporking and one (not the sporked one) function is overloaded.

Code: Select all

fun int nextStep ( int index )
{
   0 => int out;
...
   return out
}

fun int nextStep ()
{
   nextStep ( myIndex );
}

Calling "nextStep()" within an endless loop:

Code: Select all

while(true) 
{
   nextStep();
}
runs for a while and then ChucK crashes... *sigh*


[SOLUTION]
I forgot the "return" statement within the overloaded "nextStep()" function!!!

Here's how it works now:

Code: Select all

fun int nextStep ()
{
   return nextStep ( myIndex );
}

This sucker has cost me 2 hours!!!