diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-07-08 19:19:53 +0300 |
---|---|---|
committer | Michal Strehovský <MichalStrehovsky@users.noreply.github.com> | 2017-07-08 19:19:53 +0300 |
commit | c403248c511ae6567a8fccf5e0f0264b577fdc9d (patch) | |
tree | 82f5b98054fafb1fbbb985077b6107fa204671c4 /src/Runtime.Base | |
parent | 0ffa321fa67fc52f13eba89dee903a565b3e9d7a (diff) |
Remove ExceptionIDs.ThreadAbort (#4111)
ExceptionIDs represents contract between runtime and CoreLib. It does not make sense to have ExceptionIDs.ThreadAbort in it since it is never used in this contract. It was just used as a convenient internal implementation detail that can be done differently.
Diffstat (limited to 'src/Runtime.Base')
-rw-r--r-- | src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs | 14 | ||||
-rw-r--r-- | src/Runtime.Base/src/System/Runtime/ExceptionIDs.cs | 1 |
2 files changed, 4 insertions, 11 deletions
diff --git a/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs b/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs index 5b02c8ef7..aaf0cc33d 100644 --- a/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs +++ b/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs @@ -528,8 +528,9 @@ namespace System.Runtime IntPtr faultingCodeAddress = exInfo._pExContext->IP; bool instructionFault = true; + ExceptionIDs exceptionId = default(ExceptionIDs); + Exception exceptionToThrow = null; - ExceptionIDs exceptionId; switch (exceptionCode) { case (uint)HwExceptionCode.STATUS_REDHAWK_NULL_REFERENCE: @@ -545,7 +546,7 @@ namespace System.Runtime break; case (uint)HwExceptionCode.STATUS_REDHAWK_THREAD_ABORT: - exceptionId = ExceptionIDs.ThreadAbort; + exceptionToThrow = InternalCalls.RhpGetThreadAbortException(); break; case (uint)HwExceptionCode.STATUS_DATATYPE_MISALIGNMENT: @@ -571,17 +572,10 @@ namespace System.Runtime // know the complete set of HW faults generated by managed code and do not need to handle // this case. FailFastViaClasslib(RhFailFastReason.InternalError, null, faultingCodeAddress); - exceptionId = ExceptionIDs.NullReference; break; } - Exception exceptionToThrow; - - if (exceptionId == ExceptionIDs.ThreadAbort) - { - exceptionToThrow = InternalCalls.RhpGetThreadAbortException(); - } - else + if (exceptionId != default(ExceptionIDs)) { exceptionToThrow = GetClasslibException(exceptionId, faultingCodeAddress); } diff --git a/src/Runtime.Base/src/System/Runtime/ExceptionIDs.cs b/src/Runtime.Base/src/System/Runtime/ExceptionIDs.cs index dc0b16a72..52d5830c7 100644 --- a/src/Runtime.Base/src/System/Runtime/ExceptionIDs.cs +++ b/src/Runtime.Base/src/System/Runtime/ExceptionIDs.cs @@ -16,6 +16,5 @@ namespace System.Runtime NullReference = 8, AccessViolation = 9, DataMisaligned = 10, - ThreadAbort = 11, } } |