Ensure exception out argument is initialized to NULL. (#5424)
[mono.git] / mono / mini / mini-runtime.c
index 3b74b398e1bfed72b0773d0216b02bfb7208313a..a3f4883f74d5fc7ffc43c20047a7f5d254dcbc37 100644 (file)
@@ -2622,6 +2622,8 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
 #endif
 
        error_init (error);
+       if (exc)
+               *exc = NULL;
 
        if (obj == NULL && !(method->flags & METHOD_ATTRIBUTE_STATIC) && !method->string_ctor && (method->wrapper_type == 0)) {
                g_warning ("Ignoring invocation of an instance method on a NULL instance.\n");