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

Remove node from seminfo to prevent possible maximum recursion when pickling #1315

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions jac/jaclang/compiler/semtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def __init__(
self,
node: ast.AstNode,
name: str,
type: Optional[str] = None,
type_str: Optional[str] = None,
semstr: str = "",
) -> None:
"""Initialize the class."""
self.node = node
self.node_type = type(node)
self.name = name
self.type = type
self.type = type_str
self.semstr = semstr

def __repr__(self) -> str:
Expand All @@ -40,7 +40,7 @@ def get_children(
self_scope = str(scope) + f".{self.name}({self.type})"
_, children = sem_registry.lookup(scope=SemScope.get_scope_from_str(self_scope))
if filter and children and isinstance(children, list):
return [i for i in children if isinstance(i.node, filter)]
return [i for i in children if i.node_type == filter]
return children if children and isinstance(children, list) else []


Expand Down
2 changes: 1 addition & 1 deletion jac/jaclang/runtimelib/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,4 @@ def run_import(
lang=spec.language,
)
self.result = import_return
return self.result
return self.result
Loading