From: Jan Vorlicek Date: Fri, 20 Feb 2015 23:28:15 +0000 (+0100) Subject: Remove duplicate check for number of exception arguments X-Git-Tag: accepted/tizen/base/20180629.140029~7076^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=287b5475293af40f2e2f4768cdff34a8066e800d;p=platform%2Fupstream%2Fcoreclr.git Remove duplicate check for number of exception arguments I have added a check for the exception arguments in my last commit, but it turns out there was already one, only in a wrong place. So the exceptionRecord.NumberParameters was set incorrectly to the unclipped value. --- diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp index 873f62b..919c000 100644 --- a/src/pal/src/exception/seh-unwind.cpp +++ b/src/pal/src/exception/seh-unwind.cpp @@ -223,8 +223,11 @@ RaiseException(IN DWORD dwExceptionCode, dwExceptionCode ^= RESERVED_SEH_BIT; } - if (nNumberOfArguments > EXCEPTION_MAXIMUM_PARAMETERS) + if (nNumberOfArguments > EXCEPTION_MAXIMUM_PARAMETERS) { + WARN("Number of arguments (%d) exceeds the limit " + "EXCEPTION_MAXIMUM_PARAMETERS (%d); ignoring extra parameters.\n", + nNumberOfArguments, EXCEPTION_MAXIMUM_PARAMETERS); nNumberOfArguments = EXCEPTION_MAXIMUM_PARAMETERS; } @@ -238,13 +241,6 @@ RaiseException(IN DWORD dwExceptionCode, exceptionRecord.NumberParameters = nNumberOfArguments; if (nNumberOfArguments) { - if (nNumberOfArguments > EXCEPTION_MAXIMUM_PARAMETERS) - { - WARN("Number of arguments (%d) exceeds the limit " - "EXCEPTION_MAXIMUM_PARAMETERS (%d); ignoring extra parameters.\n", - nNumberOfArguments, EXCEPTION_MAXIMUM_PARAMETERS); - nNumberOfArguments = EXCEPTION_MAXIMUM_PARAMETERS; - } CopyMemory(exceptionRecord.ExceptionInformation, lpArguments, nNumberOfArguments * sizeof(ULONG_PTR)); }