Skip to content
Merged
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
11 changes: 11 additions & 0 deletions pineforge_codegen/codegen/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,16 @@ def _collect_security_ta_binding_stacks(
if bound is not None:
if isinstance(bound, str):
return collected
# Guard against a cyclic helper binding: an identifier bound to
# an expression that transitively references the same binding
# (e.g. mutually-referential helper params) would recurse here
# forever — the mutable/global/func paths below already carry a
# `resolving` guard, this path did not. Keyed by the bound node
# so acyclic bindings are unaffected (byte-identical emission).
bind_key = f"bind:{id(bound)}"
if bind_key in resolving:
return collected
resolving.add(bind_key)
self._collect_security_ta_binding_stacks(
bound,
resolving,
Expand All @@ -1181,6 +1191,7 @@ def _collect_security_ta_binding_stacks(
inline_ta_indices,
inline_helper,
)
resolving.discard(bind_key)
return collected

mutable_info = self._global_mutable_infos.get(expr_node.name)
Expand Down
Loading