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:
authorMaxim Lipnin <mlipnin@gmail.com>2018-10-10 02:59:12 +0300
committerMarek Safar <marek.safar@gmail.com>2018-10-10 02:59:12 +0300
commit98db98fe06724bc793b20a249a5e69a3a3ad9121 (patch)
tree398007d834d0ff28d1e7cc1d9f26ed4aa19d37b0
parent53f4861c2d10ab690458dee78d87d7fd94993be2 (diff)
[Reflection] Handle overflow exception on constructor invocation (#11028)
It allows to re-enable [Invoke_OneDimensionalArray_NegativeLengths_ThrowsOverflowException](https://github.com/mono/corefx/blob/master/src/System.Reflection/tests/ConstructorInfoTests.cs#L96) test and enable [TestInvoke_1DArrayWithNegativeLength](https://github.com/mono/corefx/blob/master/src/System.Runtime/tests/System/Reflection/ConstructorInfoTests.cs#L79) test. Fixes https://github.com/mono/mono/issues/10024
-rw-r--r--mcs/class/corlib/System.Reflection/MonoMethod.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.Reflection/MonoMethod.cs b/mcs/class/corlib/System.Reflection/MonoMethod.cs
index b9e1bc17f1b..d80fe01173d 100644
--- a/mcs/class/corlib/System.Reflection/MonoMethod.cs
+++ b/mcs/class/corlib/System.Reflection/MonoMethod.cs
@@ -328,6 +328,8 @@ namespace System.Reflection {
} catch (MethodAccessException) {
throw;
#endif
+ } catch (OverflowException) {
+ throw;
} catch (Exception e) {
throw new TargetInvocationException (e);
}
@@ -799,6 +801,8 @@ namespace System.Reflection {
} catch (MethodAccessException) {
throw;
#endif
+ } catch (OverflowException) {
+ throw;
} catch (Exception e) {
throw new TargetInvocationException (e);
}