Happy first birthday Field Guide!
Web site in support of a freely downloadable, Creative Commons licensed introduction to genetic programming
The 'grow' function returns -1 if we go past the maximum size limit. Consider the following line of code:return( grow( buffer, grow( buffer, pos+1, max,depth-1), max,depth-1 ) );
Let's say the nested grow returns -1. The outer grow accepts it for 'pos' i.e. index to next location in the tree to grow. There is no check inside the function grow against (pos == -1). Thus, it would raise a run time exception if used.
The reason it may not have occurred so far may be that we reach the depth constraint earlier than the size limit.