Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix a bug in ref-return-value data flow
This was missed during porting of the changes from linker.

More cleanup of tests.
  • Loading branch information
vitek-karas committed Jul 27, 2022
commit 4025601ae66fbe6c4061226a6e824d775242b4ac
Original file line number Diff line number Diff line change
Expand Up @@ -993,18 +993,7 @@ private void ScanIndirectStore(
StackSlot valueToStore = PopUnknown(currentStack, 1, methodBody, offset);
StackSlot destination = PopUnknown(currentStack, 1, methodBody, offset);

foreach (var uniqueDestination in destination.Value)
{
if (uniqueDestination is FieldValue fieldDestination)
{
HandleStoreField(methodBody, offset, fieldDestination, valueToStore.Value);
}
else if (uniqueDestination is MethodParameterValue parameterDestination)
{
HandleStoreParameter(methodBody, offset, parameterDestination, valueToStore.Value);
}
}

StoreInReference(destination.Value, valueToStore.Value, methodBody, offset, locals, curBasicBlock);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static void TestArrayWithInitializerMultipleElementsStaticType ()
}

// Bug
// [ExpectedWarning ("IL2087", nameof (DataFlowTypeExtensions.RequiresPublicFields), ProducedBy = ProducedBy.Trimmer)]
// [ExpectedWarning ("IL2087", nameof (DataFlowTypeExtensions.RequiresPublicFields), ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)]
[ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresPublicMethods), ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)]
// Below are because we do not handle Multi dimensional arrays
[ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)]
Expand Down Expand Up @@ -396,7 +396,7 @@ static void TestArraySetElementMultipleElementsStaticType ()
}

// Bug
// [ExpectedWarning ("IL2087", nameof (DataFlowTypeExtensions.RequiresPublicFields), ProducedBy = ProducedBy.Trimmer)]
// [ExpectedWarning ("IL2087", nameof (DataFlowTypeExtensions.RequiresPublicFields), ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)]
[ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresPublicMethods), ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)]
// Below are because we do not handle Multi dimensional arrays
[ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresPublicFields), ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)]
Expand All @@ -418,7 +418,7 @@ static void TestArraySetElementMultipleElementsStaticType ()
}

// Bug
// [ExpectedWarning ("IL2087", nameof (DataFlowTypeExtensions.RequiresPublicFields), ProducedBy = ProducedBy.Trimmer)]
// [ExpectedWarning ("IL2087", nameof (DataFlowTypeExtensions.RequiresPublicFields), ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)]
[ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresPublicMethods), ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)]
// Below are because we do not handle Multi dimensional arrays
[ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresPublicFields), ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ static void TestConstructors ()
RequireNothing (type);
}

// NativeAOT doesn't implement this yet: https://github.com/dotnet/runtime/issues/72833
[ExpectedWarning ("IL2105",
"Type 'System.Invalid.TypeName' was not found in the caller assembly nor in the base library. " +
"Type name strings used for dynamically accessing a type should be assembly qualified.",
Expand Down
Loading