Currently, evaluating this:
function bad (n) return n * bad(n) end bad(2)
will cause lua to produce -- infinitely, and very
quickly -- ungraceful error messages.  (It will do
this on any excess-recursion error -- I first saw
this behavior when I passed too-large a number to
a simple factorial function.)
The attached patch causes lua to generate .pir
files that push this exception handler before
evaluating any compiled-lua code:
  root_exception_handler:
    get_results '(0, 0)', $P0, $S0
    $S0 = $P0[0]
    print "Unhandled exception: "
    print $S0
    print "\n"
    exit 1
I already sent this to Klaas-Jan Stol <parro...@gmail.com> ,
but when I didn't get a reply or see the change in svn after
a few days, I RTFM'd on contributing patches.
Cheers,
Julian