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

assiging to pointer parameters does not emit stind instruction #185

Closed
adrianoc opened this issue Sep 11, 2022 · 0 comments
Closed

assiging to pointer parameters does not emit stind instruction #185

adrianoc opened this issue Sep 11, 2022 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@adrianoc
Copy link
Owner

adrianoc commented Sep 11, 2022

This is related to #184

class FixedStatementTest
{
    unsafe void DoIt(int *pp)
    {
        *pp = 42;
    }    
}

produces

//*pp = 42;
il_DoIt_2.Emit(OpCodes.Ldc_I4, 42);
il_DoIt_2.Emit(OpCodes.Starg_S, p_pp_3);
il_DoIt_2.Emit(OpCodes.Ret);

instead of something like :

//*pp = 42;
il_DoIt_2.Emit(OpCodes.Ldarg_1);
il_DoIt_2.Emit(OpCodes.Ldc_I4, 42);
il_DoIt_2.Emit(OpCodes.Stind_I4);
il_DoIt_2.Emit(OpCodes.Ret);
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