summaryrefslogtreecommitdiff
path: root/src/vm/excep.h
diff options
context:
space:
mode:
authorGaurav Khanna <gkhanna@microsoft.com>2015-09-16 11:45:06 -0700
committerGaurav Khanna <gkhanna@microsoft.com>2015-09-16 11:45:06 -0700
commit14de7d30063c2955523c1ff2ccb48e339977742b (patch)
tree57642fc0f77be01af88e595dae9360ecc9660f78 /src/vm/excep.h
parent8cad40bbcf4c404c518c1f202a0f93cf71c866c6 (diff)
downloadcoreclr-14de7d30063c2955523c1ff2ccb48e339977742b.tar.gz
coreclr-14de7d30063c2955523c1ff2ccb48e339977742b.tar.bz2
coreclr-14de7d30063c2955523c1ff2ccb48e339977742b.zip
Fix for GH issue 410 - https://github.com/dotnet/coreclr/issues/410
Whenever a managed exception is thrown, the details about the thrown exception are also saved off the managed thread object (as LastThrownObject). The VM also has an exception tracker that tracks its dispatch across the managed frames and incase of nested exceptions, the trackers are collapsed correctly, when the nested exception is handled, and last thrown object is updated correctly. The VM works on the premise that the LastThrownObject is updated correctly. Incase of this bug, a method (M1)is invoked via Reflection and has an exception E1. During exception dispatch for E1, an IL filter is invoked that, in turn, has an exception (E2) that remains unhandled. While this is swallowed by the VM (as expected), the LastThrownObject is not updated to reflect the active exception to be E1. Thus, when the dispatch for original exception E1 completes and no managed handler is found, the exception is caught by Reflection subsystem that extracts the thrown exception using the GET_THROWABLE macro that uses the LastThrownObject to determine the thrown exception. Since the LTO was not updated, it still reflects E2. The fix is to update the managed exception state, if the filter has an unhandled exception, similar to how we do when a managed catch block successfully handles the exception. I have refactored the code to make the semantic cleaner. [tfs-changeset: 1525835]
Diffstat (limited to 'src/vm/excep.h')
-rw-r--r--src/vm/excep.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm/excep.h b/src/vm/excep.h
index d411411c4c..947d7896e1 100644
--- a/src/vm/excep.h
+++ b/src/vm/excep.h
@@ -859,7 +859,7 @@ public:
void static SetupCorruptionSeverityForActiveExceptionInUnwindPass(Thread *pCurThread, PTR_ExceptionTracker pEHTracker, BOOL fIsFirstPass,
DWORD dwExceptionCode);
#endif // WIN64EXCEPTIONS
- void static ResetLastActiveCorruptionSeverityPostCatchHandler();
+ void static ResetLastActiveCorruptionSeverityPostCatchHandler(Thread *pThread);
};
#endif // FEATURE_CORRUPTING_EXCEPTIONS