[coop] Fix regression in bug-70561.cs
authorAleksey Kliger <aleksey@xamarin.com>
Tue, 14 Jun 2016 23:11:19 +0000 (19:11 -0400)
committerAleksey Kliger <aleksey@xamarin.com>
Tue, 14 Jun 2016 23:11:19 +0000 (19:11 -0400)
Match behavior of non-coop and don't set an exit code if the main method
throws an unhandled exception.

mono/metadata/object.c

index 6d67358ec0784973a90d45d3cd1a9818e1b58d97..737986052251c1385acfca6a20c6a908489ebb62 100644 (file)
@@ -4775,13 +4775,7 @@ do_exec_main_checked (MonoMethod *method, MonoArray *args, MonoError *error)
                if (is_ok (error))
                        rval = 0;
                else {
-                       /* If the return type of Main is void, only
-                        * set the exitcode if an exception was thrown
-                        * (we don't want to blow away an
-                        * explicitly-set exit code)
-                        */
                        rval = -1;
-                       mono_environment_exitcode_set (rval);
                }
        }
        return rval;