Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2015-01-23 00:01:40 +0300
committerZoltan Varga <vargaz@gmail.com>2015-01-23 00:01:49 +0300
commitaf7a963fc015637d9aa2b55e592d78d0034dc6aa (patch)
tree944719b92aae44f19ee4b24b63483e724af71f63
parent066bbf8b212ab92e735508e7a42526aa68bf0a9e (diff)
[runtime] Use the new one parameter ctor to create RuntimeWrappedException objects.
m---------external/referencesource0
-rw-r--r--mono/metadata/exception.c23
-rw-r--r--mono/metadata/object-internals.h5
3 files changed, 18 insertions, 10 deletions
diff --git a/external/referencesource b/external/referencesource
-Subproject d6d006b726472eae6612ed1f48d4ec50832eeae
+Subproject 10fc3eefe498291daf62f9c5d1358aac7fb1f45
diff --git a/mono/metadata/exception.c b/mono/metadata/exception.c
index cf42445fa78..23cb946b1ee 100644
--- a/mono/metadata/exception.c
+++ b/mono/metadata/exception.c
@@ -775,12 +775,25 @@ mono_get_exception_reflection_type_load (MonoArray *types, MonoArray *exceptions
MonoException *
mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception)
{
- MonoRuntimeWrappedException *ex = (MonoRuntimeWrappedException*)
- mono_exception_from_name (mono_get_corlib (), "System.Runtime.CompilerServices",
- "RuntimeWrappedException");
+ MonoClass *klass;
+ MonoObject *o;
+ MonoMethod *method;
+ MonoDomain *domain = mono_domain_get ();
+ gpointer params [16];
- MONO_OBJECT_SETREF (ex, wrapped_exception, wrapped_exception);
- return (MonoException*)ex;
+ klass = mono_class_from_name (mono_get_corlib (), "System.Runtime.CompilerServices", "RuntimeWrappedException");
+ g_assert (klass);
+
+ o = mono_object_new (domain, klass);
+ g_assert (o != NULL);
+
+ method = mono_class_get_method_from_name (klass, ".ctor", 1);
+ g_assert (method);
+
+ params [0] = wrapped_exception;
+ mono_runtime_invoke (method, o, params, NULL);
+
+ return (MonoException *)o;
}
static gboolean
diff --git a/mono/metadata/object-internals.h b/mono/metadata/object-internals.h
index 11bb021a36f..9266e9db2b1 100644
--- a/mono/metadata/object-internals.h
+++ b/mono/metadata/object-internals.h
@@ -286,11 +286,6 @@ typedef struct {
} MonoTypeLoadException;
typedef struct {
- MonoException base;
- MonoObject *wrapped_exception;
-} MonoRuntimeWrappedException;
-
-typedef struct {
MonoObject object;
MonoObject *async_state;
MonoObject *handle;