Skip to content

Linker doesn't track references/addresses for ldind.ref and always push an UnknownValue to the stack #85465

@jtschuster

Description

@jtschuster

The linker doesn't properly handle when a ref variable is assigned to another ref variable by value.

For example, all values below are properly annotated, but will warn as assigning an unknown value to an annotated variable:

ref struct RS
{
    [DAM(DAMT.PublicMethods)]
    ref Type T;
}
void Method([DAM(DAMT.PublicMethods)] ref Type param, RS rs)
{
    ref Type t = GetRefTypeWithMethods();
    param = t; // Warns with t as an unknown value
    rs.T = t; // Warns
    rs.T = param; // Warns
    param = rs.T; // Warns
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Tools-ILLink.NET linker development as well as trimming analyzers

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions