diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2016-12-12 21:03:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-12 21:03:30 +0100 |
commit | e45bce1a64bd30c462abf51ab3b4eec69d5346aa (patch) | |
tree | 1f0169edfc221b241f92d1588221fd9fcaa009ad /Xamarin.Forms.Build.Tasks | |
parent | 8257753d1b48de0e81d5bd431604f60d2065b6cc (diff) | |
download | xamarin-forms-e45bce1a64bd30c462abf51ab3b4eec69d5346aa.tar.gz xamarin-forms-e45bce1a64bd30c462abf51ab3b4eec69d5346aa.tar.bz2 xamarin-forms-e45bce1a64bd30c462abf51ab3b4eec69d5346aa.zip |
[XamlC] Box valueTypes on Add() (#624)
This doesn't happen often, and I haven't found any valid XAML file out
there requiring this, but in the case of 49307, it at least generates
valid IL, which then fails with a NRE as this is the nature of callvirt.
Diffstat (limited to 'Xamarin.Forms.Build.Tasks')
-rw-r--r-- | Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs b/Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs index 67c345ff..6a7a3bef 100644 --- a/Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs +++ b/Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs @@ -1034,6 +1034,8 @@ namespace Xamarin.Forms.Build.Tasks yield return Instruction.Create(OpCodes.Ldloc, vardef); if (implicitOperator != null) yield return Instruction.Create(OpCodes.Call, module.Import(implicitOperator)); + if (implicitOperator == null && vardef.VariableType.IsValueType && !childType.IsValueType) + yield return Instruction.Create(OpCodes.Box, vardef.VariableType); yield return Instruction.Create(OpCodes.Callvirt, adderRef); if (adderRef.ReturnType.FullName != "System.Void") yield return Instruction.Create(OpCodes.Pop); |