Commit c7dd5f0d authored by vosen's avatar vosen

Fix broken IL when generating default value-typed values.

parent 7fe87dc6
......@@ -1665,9 +1665,16 @@ static List<FieldInfo> GetSettableFields(Type t)
{
Type itemType = item.Property != null ? item.Property.Type : item.Field.FieldType;
if (itemType.IsValueType)
{
il.DeclareLocal(itemType);
il.Emit(OpCodes.Ldloca_S, (byte)(index + 2));
il.Emit(OpCodes.Initobj, itemType);
il.Emit(OpCodes.Ldloc, (short)(index + 2));
}
else
{
il.Emit(OpCodes.Ldnull);
}
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment