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

Fix incorrect circular reference detection #1566

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Oct 24, 2022

Fixes #1565

Circular reference detection released in v0.42.0 is broken. The detection logic builds a call stack and determines that it is circular-referenced if the same address appears multiple times.

This call stack should literally be the stack. It should be popped after every push instead of clearing it at the end. The current detection logic detects erroneous circular references when the same local value appears multiple times in the middle.

graph LR
  local.foo ---> local.bar
  local.foo ---> local.bar
  local.bar ---> local.baz
Loading

This PR fixes the detection logic by using the stack correctly.

@wata727 wata727 force-pushed the fix_incorrect_circular_reference_detection branch from ced535c to 9ff01a2 Compare October 24, 2022 15:15
@Shr3ps

This comment was marked as off-topic.

@wata727 wata727 force-pushed the fix_incorrect_circular_reference_detection branch from 9ff01a2 to c367d84 Compare October 24, 2022 16:33
@wata727 wata727 merged commit 785c0e1 into master Oct 24, 2022
@wata727 wata727 deleted the fix_incorrect_circular_reference_detection branch October 24, 2022 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Error: Circular reference found
2 participants