This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 12635 - Tail calls inside continuations cause StackOverflow
: Tail calls inside continuations cause StackOverflow
Status: NEW
Product: Runtime
Classification: Mono
Component: JIT
: unspecified
: PC Mac OS
: Normal normal
: ---
Assigned To: Zoltan Varga
  Show dependency treegraph
Reported: 2013-06-11 13:49 EDT by Natallie
Modified: 2014-11-12 04:29 EST (History)
6 users (show)

See Also:
Test Case URL:
External Submit: ---


Description Natallie 2013-06-11 13:49:31 EDT
The following sample program fails with StackOverflow:

let rec f x cont =
    if x < 0 then 0
    elif x = 0 then cont x
    else f (x-1) (fun x -> f x cont)

f 250000 id

Rewriting the functions so that they all have a single parameter doesn't help

Note You need to log in before you can comment on or make changes to this bug.