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

Merged

Conversation

tomer-amir
Copy link
Contributor

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.

@barapiiro
Copy link
Contributor

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.

Hi, I added some test cases that work only after the fix.
we would appreciate it if you'll take another look and merge it 🙏🏽

@EdwardCooke EdwardCooke merged commit 53cfe3e into aaubry:master May 29, 2024
1 check passed
@aaubry
Copy link
Owner

aaubry commented May 29, 2024

This feature has been released in version 15.1.6.

@tomer-amir tomer-amir deleted the fix-hash-code-infinite-recursion branch May 30, 2024 20:11
petrochuk added a commit to microsoft/PowerApps-Tooling that referenced this pull request Jun 6, 2024
petrochuk added a commit to microsoft/PowerApps-Tooling that referenced this pull request Jun 7, 2024
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.

4 participants