C stack check in compiler should call compile_exception
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=3080
Reported by Martin Stjernholm mast@roxen.com
The C stack check in docode.c complains with this compilation error:
Too deep recursion in compiler. (please report this)
It seems that it can occur normally if the compiler is run when there's too little stack left. Since this is reported only as a compiler error, the resulting backtrace contains the error "Compilation failed", which is misleading, especially when the compilation errors has been diverted and reported somewhere else.
This should be fixed by handling this stack check just like any other, i.e. by throwing an error, catching it and calling compile_exception (and lifting the stack margins during that call; those should probably be lifted for all compile_exception calls, btw).