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

Referencing properties/events on a value type loads the value type value instead of its address. #166

Closed
3 tasks done
adrianoc opened this issue Mar 13, 2022 · 0 comments
Closed
3 tasks done
Labels
🐛 bug Something isn't working

Comments

@adrianoc
Copy link
Owner

adrianoc commented Mar 13, 2022

Since Span is a value type any method/property reference should go through the address of the variable instead of its value.

Test need to cover Span as:

  • Local variables
  • Parameters
  • Fields
class C 
{ 
	static int M2(System.Span<int> span) => span.Length;
}

generates:

il_M_2.Emit(OpCodes.Ldarg_0);

instead of

il_M_2.Emit(OpCodes.Ldarga, p_span_3);

@adrianoc adrianoc added the 🐛 bug Something isn't working label Mar 13, 2022
@adrianoc adrianoc changed the title Referencing Span<T> methods/properties loads span as a value instead of its address. Referencing value type properties loads its value instead of its address. Mar 14, 2022
@adrianoc adrianoc changed the title Referencing value type properties loads its value instead of its address. Referencing properties/events on a value type loads the value type value instead of its address. Mar 14, 2022
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