quipu mercurial repository
Revision | 0fef660ef8574ceae6287cf012af12152111edc6 (tree) |
---|---|
Time | 2018-05-20 15:25:01 |
Author | Agustina Arzille <avarzille@rise...> |
Commiter | Agustina Arzille |
Fix tail calls in native functions
@@ -2219,7 +2219,7 @@ | ||
2219 | 2219 | #endif |
2220 | 2220 | |
2221 | 2221 | if (cdp != 0) |
2222 | - { // Restored from an exception caught. | |
2222 | + { // Restored from a caught exception. | |
2223 | 2223 | top_frame = cdp->topf; |
2224 | 2224 | nargs = as_int (stack[interp->cur_frame - 3]); |
2225 | 2225 | bp = interp->cur_frame - interpreter::frame_overhead - nargs; |
@@ -2335,7 +2335,7 @@ | ||
2335 | 2335 | { |
2336 | 2336 | if (native_fct_p (fn)) |
2337 | 2337 | { |
2338 | - as_native_fct(fn)->call (interp, n); | |
2338 | + as_native_fct(fn)->call (interp, &stack[sp - n], n); | |
2339 | 2339 | sp -= n; |
2340 | 2340 | stack[sp - 1] = retval; |
2341 | 2341 | locals = U_PREV_LC (); |