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 infinite recursion of the hash code function of YamlMappingNode #808

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomer-amir
Copy link

I have an issue where the hash code function enters infinite recursion in some cases with circular references.
This is a suggestion to fix the issue, as I noticed that the start position seems unique, so that can be relied on, and this does not require any recursion.

Please tell me if you think that there is a better fix, but this worked for me when I tested it.

Here is an example that causes infinite recursion:

? !Key
    properties:
            properties:
                rowID: &id1 !Key
                        rowID: *id1
: *id2

I am not sure what exactly causes the issue here, this is a filtered snippet from a YAML I was trying to parse and I got the issue with, so it might not be exactly valid, but it reproduces the issue and verifies the fix.

@EdwardCooke
Copy link
Collaborator

We need some tests for the fix to make sure we don't accidentally break it in the future. If you can add those we can look at merging it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants