Avoid stackoverflow on recursive tail calls #60
Labels
No labels
blocked
another_issue
blocked
design
blocked
vendor
cat
bug
cat
correctness
cat
feature
cat
maintainance
cat
performance
cat
testing
cat
thinking
cat
ux
mua
mutt
mua
thunderbird
prio
high
prio
low
prio
mid
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/aerogramme#60
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Aerogramme has some recursive functions managing user data.
Inputs can be crafted so that Aerogramme will crash.
We can use the tailcall module and rewrite our function a little bit to avoid that.
But sometimes it's not possible to do tailcall optimizations.
We could of course use a stack to rewrite our logic.
However it will make the code harder to read.
So, probably, the right solution would be simply to limit the depth of the recursion.
Putting limits every places we have user data is probably a good idea...
Implement tailcall optimizationto Avoid stackoverflow on recursive tail calls