diff options
author | Maxim Lipnin <mlipnin@gmail.com> | 2018-10-10 02:59:12 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-10-10 02:59:12 +0300 |
commit | 98db98fe06724bc793b20a249a5e69a3a3ad9121 (patch) | |
tree | 398007d834d0ff28d1e7cc1d9f26ed4aa19d37b0 | |
parent | 53f4861c2d10ab690458dee78d87d7fd94993be2 (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.cs | 4 |
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); } |