Skip to content

Commit 7e00eac

Browse files
committed
Remove node from seminfo to prevent possible maximum recursion upon
pickling
1 parent f1566c3 commit 7e00eac

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

jac/jaclang/compiler/semtable.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ def __init__(
1919
self,
2020
node: ast.AstNode,
2121
name: str,
22-
type: Optional[str] = None,
22+
type_str: Optional[str] = None,
2323
semstr: str = "",
2424
) -> None:
2525
"""Initialize the class."""
26-
self.node = node
26+
self.node_type = type(node)
2727
self.name = name
28-
self.type = type
28+
self.type = type_str
2929
self.semstr = semstr
3030

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

4646

jac/jaclang/runtimelib/importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,4 +362,4 @@ def run_import(
362362
lang=spec.language,
363363
)
364364
self.result = import_return
365-
return self.result
365+
return self.result

0 commit comments

Comments
 (0)