2004-09-22 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Wed, 22 Sep 2004 16:22:37 +0000 (16:22 -0000)
committerMartin Baulig <martin@novell.com>
Wed, 22 Sep 2004 16:22:37 +0000 (16:22 -0000)
Thanks to Peter Sestoft for this bug report.

* expression.cs (Conditional): If both the `trueExpr' and the
`falseExpr' is a NullLiteral, return a NullLiteral.

svn path=/trunk/mcs/; revision=34237

mcs/gmcs/ChangeLog
mcs/gmcs/expression.cs
mcs/mcs/ChangeLog
mcs/mcs/expression.cs

index a284b383f359624d04fa1dde023d812ff81ae5ae..ec2a6fc0b4ac0fdd99d8e9da8dd0fbc054192072 100755 (executable)
@@ -1,3 +1,10 @@
+2004-09-22  Martin Baulig  <martin@ximian.com>
+
+       Thanks to Peter Sestoft for this bug report.
+
+       * expression.cs (Conditional): If both the `trueExpr' and the
+       `falseExpr' is a NullLiteral, return a NullLiteral.
+
 2004-09-22  Martin Baulig  <martin@ximian.com>
 
        * statement.cs (Foreach.EmitCollectionForeach): If we're in an
index 24dbb49389cdbb7122f7ef541d0e2aa569b89960..d7f95a5da8325910b8c013210b85a6aad0f53db9 100755 (executable)
@@ -3484,6 +3484,9 @@ namespace Mono.CSharp {
                        if (trueExpr == null || falseExpr == null)
                                return null;
 
+                       if ((trueExpr is NullLiteral) && (falseExpr is NullLiteral))
+                               return trueExpr;
+
                        eclass = ExprClass.Value;
                        if (trueExpr.Type == falseExpr.Type)
                                type = trueExpr.Type;
index 056c20624af4b8951260506247bca3f2c97237fd..fa11e8e6e19735f62fc941d2b5bd6224faee5e1d 100755 (executable)
@@ -1,3 +1,10 @@
+2004-09-22  Martin Baulig  <martin@ximian.com>
+
+       Thanks to Peter Sestoft for this bug report.
+
+       * expression.cs (Conditional): If both the `trueExpr' and the
+       `falseExpr' is a NullLiteral, return a NullLiteral.
+
 2004-09-22  Martin Baulig  <martin@ximian.com>
 
        * statement.cs (Foreach.EmitCollectionForeach): If we're in an
index f895e702afe2a99bbeba79cd25df61ef8ae935fd..eb2d1f14447e34b73b213927c8a24087051e1073 100755 (executable)
@@ -3462,6 +3462,9 @@ namespace Mono.CSharp {
                        if (trueExpr == null || falseExpr == null)
                                return null;
 
+                       if ((trueExpr is NullLiteral) && (falseExpr is NullLiteral))
+                               return trueExpr;
+
                        eclass = ExprClass.Value;
                        if (trueExpr.Type == falseExpr.Type)
                                type = trueExpr.Type;