Skip to content

Commit

Permalink
Add null constant argument type check
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar committed Jul 31, 2013
1 parent 8ffb6b1 commit 01697c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mcs/mcs/constant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2057,8 +2057,10 @@ public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder e
{
switch (targetType.BuiltinType) {
case BuiltinTypeSpec.Type.Object:
// Type it as string cast
enc.Encode (rc.Module.Compiler.BuiltinTypes.String);
// Type null literal it as string cast
if (type.BuiltinType == BuiltinTypeSpec.Type.Object)
enc.Encode (rc.Module.Compiler.BuiltinTypes.String);

goto case BuiltinTypeSpec.Type.String;
case BuiltinTypeSpec.Type.String:
case BuiltinTypeSpec.Type.Type:
Expand Down

0 comments on commit 01697c1

Please sign in to comment.