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

IL2CPP Adding a KeyValuePair value to the List corrupts that value in the list #848

Open
Release opened this issue Apr 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Release
Copy link

Release commented Apr 27, 2024

What happened?

[Message: Preloader] BepInEx 6.0.0-be.688 - Withering Rooms
[Message: Preloader] Built from commit 4901521

Create a KeyValuePair value.
Read its key/value - everything is fine.
Add the value to the List.
Read the value from the list - we get a garbage value in the key/value.

Same thing if you try to change an existing value in the list.

Steps to reproduce

Code:

List<KeyValuePair<int, string>> list = new();

var item = new KeyValuePair<int, string>(0, "First");
list.Add(item);
Debug.Log("Item is: " + item.Key + " - " + item.Value);

item = new KeyValuePair<int, string>(1, "Second");
list.Add(item);
Debug.Log("Item is: " + item.Key + " - " + item.Value);

foreach (KeyValuePair<int, string> keyValue in list)
{
    Debug.Log("KeyValue is: " + keyValue.Key + " - " + keyValue.Value);
}

Result:

Item is: 0 - First
Item is: 1 - Second
KeyValue is: -2110181048 -
KeyValue is: -2110181048 -

BepInEx Distribution

Bleeding Edge from BepisBuilds

Log outputs

No response

Environment

- OS: Windows 11
- BepInEx: BepInEx 6.0.0-be.688
- Game: Withering Rooms
@Release Release added the bug Something isn't working label Apr 27, 2024
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

No branches or pull requests

1 participant