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

Pointers #20

Closed
adrianoc opened this issue Oct 8, 2019 · 1 comment
Closed

Pointers #20

adrianoc opened this issue Oct 8, 2019 · 1 comment
Labels
🎃 good first issue Good for newcomers
Milestone

Comments

@adrianoc
Copy link
Owner

adrianoc commented Oct 8, 2019

Address of does not work.
For instance:

class C
{
    unsafe void Foo()
    {
       int j  = 10;
       int *p = &j;
    }
}

Generates:

     var lv_p8 = new VariableDefinition(assembly.MainModule.ImportReference(typeof(int *)));
     C_Foo_.Body.Variables.Add(lv_p8);
     // We are missing these calls
     //var StlocX = il_C_Foo_.Create(OpCodes.Ldloca, lv_j5);
     //il_C_Foo_.Append(StlocX);
     var Stloc9 = il_C_Foo_.Create(OpCodes.Stloc, lv_p8);
     il_C_Foo_.Append(Stloc9);
     var Ret10 = il_C_Foo_.Create(OpCodes.Ret);
     il_C_Foo_.Append(Ret10);

Example:
https://cecilifier.me/?gistid=a3a2013714fdf0c2326f873760646076

@adrianoc adrianoc mentioned this issue Oct 8, 2019
100 tasks
@adrianoc adrianoc added the 🎃 good first issue Good for newcomers label Oct 10, 2019
@adrianoc adrianoc added this to the v1.4 milestone Oct 15, 2019
@adrianoc
Copy link
Owner Author

Implemented in 22e5c2d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎃 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant