Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max recursion depth when renaming symbol with addr modifier #11

Closed
aazuspan opened this issue Aug 12, 2024 · 0 comments · Fixed by #15
Closed

Max recursion depth when renaming symbol with addr modifier #11

aazuspan opened this issue Aug 12, 2024 · 0 comments · Fixed by #15
Labels
bug Something isn't working

Comments

@aazuspan
Copy link
Owner

I was attempting to rename a symbol ap1# in a SPINAsm file with 80 lines and got a max recursion depth limit error arising from the deepcopy in Token._clone. Removing lines from the file and increasing the recursion limit both resolved the issue.

I think the problem is that by tracking the next and previous token for each token, I end up with a doubly linked list that includes every token in the program, so deep copying a single token ends up with a huge call stack, and probably being way more expensive than necessary.

I could fix this by making _clone smarter and just shallowly copying everything except for the symbol dict, but I'm tempted to just remove next_token and prev_token since I'm not currently using that functionality...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant