BUG: Expression crash due to stack overflow / overrun
Expressions involving simple recursion such as layer(index - 1) can severely crash After Effects due to a lack of caching.
Anything involving previous layers, for example:
thisComp.layer(index - 1).effect("Slider Control")("Slider") + 1
When duplicated enough causes AE to crash.
With the ExtendScript engine, it usually causes a warning message.
Here are some example projects for testing:
Crash_Example and Crash_Example_2 would likely run if previous expressions were cached, rather than re-evaluated every time.