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

Too big functions crash the system #17

Open
uuk0 opened this issue Jun 30, 2023 · 2 comments
Open

Too big functions crash the system #17

uuk0 opened this issue Jun 30, 2023 · 2 comments

Comments

@uuk0
Copy link
Owner

uuk0 commented Jun 30, 2023

Functions requiring EXTENDED_ARG instructions somehow crash our system with a recursion exception

Tested with more than 256 local variable names

@uuk0
Copy link
Owner Author

uuk0 commented Jun 30, 2023

TestCase:

import string

code = "def target():\n"

for string in itertools.product(string.ascii_lowercase, repeat=2):
    code += f"    _{''.join(string)} = 0\n"

code += "    return _zz"

space = {}
exec(code, space)

target = space["target"]
self.assertEqual(target(), 0)

mutable = MutableFunction(target)
mutable.reassign_to_function()

self.assertEqual(target(), 0)

@uuk0
Copy link
Owner Author

uuk0 commented Jun 30, 2023

Seems like we need to rewrite optimise_tree() to be non-recursive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant