Skip to content

Commit

Permalink
Merge pull request mono#135 from eue/mono-2-10
Browse files Browse the repository at this point in the history
-checked command-line option
  • Loading branch information
marek-safar committed Jul 20, 2011
2 parents dd4afcf + 70352e1 commit c5302ba
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mcs/mcs/context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,15 @@ public void Dispose ()
}
}

public BuilderContext ()
{
//
// The default setting comes from the command line option
//
if (RootContext.Checked)
flags |= Options.CheckedScope;
}

Options flags;

public bool HasSet (Options options)
Expand Down
23 changes: 23 additions & 0 deletions mcs/tests/test-804.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Compiler options: -checked
//
// from bug #706877
//


public class Bug
{
public static int Main()
{
try
{
long x = long.MaxValue;
System.Console.WriteLine(x+1);
}
catch(System.OverflowException ex)
{
return 0;
}
return 1;
}
}

0 comments on commit c5302ba

Please sign in to comment.