Skip to content

Bugfix: Stackoverflow on readonly self reference#1991

Merged
latonz merged 7 commits into
riok:mainfrom
faddiv:bugfix/stackoverflow-on-readonly-self-reference
Nov 17, 2025
Merged

Bugfix: Stackoverflow on readonly self reference#1991
latonz merged 7 commits into
riok:mainfrom
faddiv:bugfix/stackoverflow-on-readonly-self-reference

Conversation

@faddiv

@faddiv faddiv commented Oct 18, 2025

Copy link
Copy Markdown
Contributor

Bugfix: Stackoverflow on readonly self reference

Description

This PR fixes the case in the mapping when there is a circular reference of existing target mapping and no writable property along the path.

Fixes #1882

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code
  • Hard-to-understand areas of my code are commented
  • The documentation is updated (as applicable)
  • Unit tests are added/updated
  • Integration tests are added/updated (as applicable, especially if feature/bug depends on roslyn or framework version in use)

@faddiv

faddiv commented Oct 18, 2025

Copy link
Copy Markdown
Contributor Author

Hi @latonz

I wanted to fix this, too, but it was a hard nut to crack. In the end, I found this solution, which works.
Although I have some questions:

  • I'm unsure if this is the best solution.
  • Are there other cases that should be covered?
  • Should it be reported, or ignored?

@latonz latonz added the bug Something isn't working label Oct 31, 2025
@latonz

latonz commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Thank you for this contribution. It looks good to me. Can't the same happen for init only members, ctor parameters and expression mappings?

@faddiv

faddiv commented Nov 1, 2025

Copy link
Copy Markdown
Contributor Author

For the init-only members, this can also occur if there is a read-only file in the path. I added tests where both are init-only, and one is read-only.
For the ctor parameters and expression mappings, it doesn't cause problems even on the main branch.

@latonz
latonz merged commit 3125fbb into riok:main Nov 17, 2025
20 of 21 checks passed
@latonz

latonz commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

Thank you for this contribution!

@faddiv
faddiv deleted the bugfix/stackoverflow-on-readonly-self-reference branch December 25, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stackoverflow exception with Devexpress.Xpo

2 participants