Skip to content

impAssignTempGen changes source type #1

@sandreenko

Description

@sandreenko
    struct A
    {        
        public int a;
        public int b;
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    static A foo()
    {
        A a = new A();
        a.a = 1;
        a.b = 2;
        return a;
    }

    public static int Main()
    {       
        return foo().a;
    }

call return result will be saved into local variable.
impAssignTempGen will change call->getType() from struct to long.
It is not good code. There are many workarounds for this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions