Merge pull request #3100 from lambdageek/dev/monoerror-exns
[mono.git] / mono / metadata / appdomain.c
index 32f0c9fd7b2a28bdd7c1d0c4059c7246386e8f04..eb3f68204036d2f79ab525c3995a8a3a689867e4 100644 (file)
@@ -39,6 +39,7 @@
 #include "mono/metadata/metadata-internals.h"
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/exception.h>
+#include <mono/metadata/exception-internals.h>
 #include <mono/metadata/threads.h>
 #include <mono/metadata/threadpool-ms.h>
 #include <mono/metadata/socket-io.h>
@@ -189,16 +190,19 @@ create_domain_objects (MonoDomain *domain)
         * Create an instance early since we can't do it when there is no memory.
         */
        arg = mono_string_new (domain, "Out of memory");
-       domain->out_of_memory_ex = mono_exception_from_name_two_strings (mono_defaults.corlib, "System", "OutOfMemoryException", arg, NULL);
+       domain->out_of_memory_ex = mono_exception_from_name_two_strings_checked (mono_defaults.corlib, "System", "OutOfMemoryException", arg, NULL, &error);
+       mono_error_assert_ok (&error);
 
        /* 
         * These two are needed because the signal handlers might be executing on
         * an alternate stack, and Boehm GC can't handle that.
         */
        arg = mono_string_new (domain, "A null value was found where an object instance was required");
-       domain->null_reference_ex = mono_exception_from_name_two_strings (mono_defaults.corlib, "System", "NullReferenceException", arg, NULL);
+       domain->null_reference_ex = mono_exception_from_name_two_strings_checked (mono_defaults.corlib, "System", "NullReferenceException", arg, NULL, &error);
+       mono_error_assert_ok (&error);
        arg = mono_string_new (domain, "The requested operation caused a stack overflow.");
-       domain->stack_overflow_ex = mono_exception_from_name_two_strings (mono_defaults.corlib, "System", "StackOverflowException", arg, NULL);
+       domain->stack_overflow_ex = mono_exception_from_name_two_strings_checked (mono_defaults.corlib, "System", "StackOverflowException", arg, NULL, &error);
+       mono_error_assert_ok (&error);
 
        /*The ephemeron tombstone i*/
        domain->ephemeron_tombstone = mono_object_new_checked (domain, mono_defaults.object_class, &error);