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

Accessing member of a value type through an array element generates incorrect code #247

Closed
adrianoc opened this issue Aug 5, 2023 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@adrianoc
Copy link
Owner

adrianoc commented Aug 5, 2023

struct S { public int Value { get; set; } }

class Foo
{
   int M(S[] sa) =>  sa[0].Value;
}
il_M_9.Emit(OpCodes.Ldarg_1);
il_M_9.Emit(OpCodes.Ldc_I4, 0);
il_M_9.Emit(OpCodes.Ldelem_Any, st_S_0); // Should be `Ldelema, st_S_0` instead
il_M_9.Emit(OpCodes.Call, md_get_2);
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