Skip to content

Commit

Permalink
[Reflection] Handle overflow exception on constructor invocation (#11028
Browse files Browse the repository at this point in the history
)

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 #10024
  • Loading branch information
MaximLipnin authored and marek-safar committed Oct 9, 2018
1 parent 53f4861 commit 98db98f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mcs/class/corlib/System.Reflection/MonoMethod.cs
Expand Up @@ -328,6 +328,8 @@ public override Object Invoke (Object obj, BindingFlags invokeAttr, Binder binde
} catch (MethodAccessException) {
throw;
#endif
} catch (OverflowException) {
throw;
} catch (Exception e) {
throw new TargetInvocationException (e);
}
Expand Down Expand Up @@ -799,6 +801,8 @@ public object InternalInvoke (object obj, object[] parameters, bool wrapExceptio
} catch (MethodAccessException) {
throw;
#endif
} catch (OverflowException) {
throw;
} catch (Exception e) {
throw new TargetInvocationException (e);
}
Expand Down

0 comments on commit 98db98f

Please sign in to comment.