2003-03-05 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Thu, 6 Mar 2003 02:02:03 +0000 (02:02 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Thu, 6 Mar 2003 02:02:03 +0000 (02:02 -0000)
* cfold.cs: Catch division by zero in modulus operator during
constant folding.

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

mcs/mcs/cfold.cs

index 72726d973355ba845cfc0573ef05fcf5f633d976..82938713b3996b829d28b7bc06c078bfd532a22e 100755 (executable)
@@ -802,6 +802,8 @@ namespace Mono.CSharp {
                                        } else {
                                                throw new Exception ( "Unexepected input: " + left);
                                        }
+                               } catch (DivideByZeroException){
+                                       Report.Error (020, loc, "Division by constant zero");
                                } catch (OverflowException){
                                        Error_CompileTimeOverflow (loc);
                                }