Skip to content

possible stack overflow in math parser #405

Description

@trillllian
  • parse_unops can do basically infinite recursion (if you stick enough unary operators on an expression). to fix it we should probably add a recurseblock to it. (it's also possible to rewrite it using a manual stack instead but i'm not sure there's any point, given that the ast it generates will be highly recursive anyways.)
  • math evaluation can do infinite recursion. this is trivial with recursive user functions (function f(x) = f(x)) but even without that, a pile of user functions where each function is a huge expression will still cause evaluation recursion depth to exceed the depth encountered when parsing. to fix this i guess we need to stick recurseblocks inside the implementation of every single math_ast node??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions