Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/coreclr/tools/ILVerification/ILImporter.Verify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,7 @@ void ImportLoadField(int token, bool isStatic)
actualThis = StackValue.CreateByRef(actualThis.Type);

var declaredThis = owningType.IsValueType ?
StackValue.CreateByRef(owningType) : StackValue.CreateObjRef(owningType);
StackValue.CreateByRef(owningType, readOnly : true) : StackValue.CreateObjRef(owningType);

CheckIsAssignable(actualThis, declaredThis);

Expand Down
13 changes: 13 additions & 0 deletions src/tests/ilverify/ILTests/ValueTypeTests.il
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@
}
}

.class public sequential ansi sealed beforefieldinit ValueTypeFieldTests
extends [System.Runtime]System.ValueType
{
.field public int32 InstanceField

.method public static int32 ValueType.UnboxLdfld_Valid(object o) cil managed
{
ldarg.0
unbox ValueTypeFieldTests
ldfld int32 ValueTypeFieldTests::InstanceField
ret
}
}