Is there any way to remove pointers from the function call stack without having to make my function return?
can you please say a little more what you mean?
If I was in functionA, which calls functionB, which calls functionC, I want to be able to cut the function call stack data for functionB so I can then return directly from functionC to functionA. Also, My program uses a large recursive set of functions which I can know my program is not returning from, so I want to be able to cut down on some of the function calls in the middle of the function call stack so my program does not crash due to the function call stack overflowing.
I would probably return a value from FunctionC and in FunctionB check what did FunctionC return and if its the “return value” then it will return too.
If FunctionC doesnt return anything then it can be just true/false, if it returns a positive number you can use -1, but if it needs to return something else you can also use global variables to return from FunctionB
you could use an array and return [val, returnNow], to actually manipulate the call stack I could try to do but it would require javascript and shims and complicated stuff.
No in blocks and I’m sure there is a better way to do this if you’re in JavaScript. JavaScript supports named loops, which could work for whatever you’re trying to do here?
If you are reaching the call stack limit then you have much bigger issues and you need to figure out how to rewrite this with loops instead of recursive functions.