Having solved Project Euler 300 I wanted to explore which of the strictly superior fold set were redundant but started getting an exception thrown after a few iterations.

I've changed the offending part to try to make it as impact-free as possible (my code is not pretty :)), it's now pure and the return is only used with writeln to track the progress of the function yet it still causes an exception after 4 or 5 iterations.

http://pastebin.com/j6REskhd

The offending function is 'solve', which I've repeatedly called to make the exception as simple as possible along with const data and limited use of the return data. I've tried making it pure/const as well as adding delete on the main data and also removing pure and calling the garbage collector. This is the stack trace crash assembler command:

7C90E8E5  push        ebx

Does this mean there is a stack overflow? Any ideas what on earth is going on?

Reply via email to