[runtime] Return early so mono_value_box_checked doesn't clobber error (#3172)
authorAlexander Kyte <alexmkyte@gmail.com>
Thu, 16 Jun 2016 15:18:19 +0000 (11:18 -0400)
committerZoltan Varga <vargaz@gmail.com>
Thu, 16 Jun 2016 15:18:19 +0000 (11:18 -0400)
mono/mini/mini-runtime.c

index 816a8965700e0854082d45426870738e0bd7f270..4baf5ab51950b4d9a3f3bb9b77156e2c0007b352 100644 (file)
@@ -2348,8 +2348,10 @@ mono_llvmonly_runtime_invoke (MonoMethod *method, RuntimeInvokeInfo *info, void
        runtime_invoke = (MonoObject *(*)(MonoObject *, void **, MonoObject **, void *))info->runtime_invoke;
 
        runtime_invoke (NULL, args, exc, info->compiled_method);
-       if (exc && *exc)
+       if (exc && *exc) {
                mono_error_set_exception_instance (error, (MonoException*) *exc);
+               return NULL;
+       }
 
        if (sig->ret->type != MONO_TYPE_VOID && info->ret_box_class)
                return mono_value_box_checked (domain, info->ret_box_class, retval, error);