Fix comparer in StringTokenMap#81341
Conversation
|
Is there a way to test? |
|
I'm not sure how exactly did duplicate strings find its way to the map, I can try to figure it out to add an end-to-end test. I could also add just a unit test of the StringTokenMap. |
|
Unit test would do. End-to-end might be too fragile. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
@dotnet/roslyn-compiler for reviews, thanks; this fixes a regression and will be backported |
Is my understanding correct that this issue is a regression caused by a PR that got merged violating merging policy for PRs touching code under Compilers? Specifically, the PR didn't get two sign-offs from the compiler team and the only sign-off from the compiler team wasn't from a senior developer? |
|
There was a sign off from Chuck (it's not displayed as green checkmark now but was at the time) and me, so that shouldn't be a violation.
I was not aware of this requirement. |
I guess not, for whatever reason Chuck's sign-off is grayed out in the GitHub UI. |
|
@dotnet/roslyn-compiler for a second review, thanks |
|
@dotnet/roslyn-compiler for a second review, this is soft-approved for .net servicing due next week, thanks |
Backport of #81341. QB workitem: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2643422 ### Customer Impact Customers are unable to build large projects which contain many string literals because the limit is being computed incorrectly. The [vsfeedback ticket](https://dev.azure.com/devdiv/DevDiv/_workitems/edit/2641964) has collected 4 votes in 1 day. ### Regression - [x] Yes - from #78033; worked in VS 2022, broken in VS 2026 - [ ] No ### Testing Verified manually on user's repro. Also added a unit test. ### Risk Low. Simple change.
Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/2641964.
StringTokenMap (added in #78033; cc @tmat) used reference equality comparer; I believe by mistake; which made it possible for it to contain the same string multiple times; leading to overflowing the user string heap limit sooner than before.