Fix one more exception handling issue
authorJan Vorlicek <janvorli@microsoft.com>
Thu, 9 Apr 2015 18:56:37 +0000 (20:56 +0200)
committerJan Vorlicek <janvorli@microsoft.com>
Fri, 10 Apr 2015 09:00:43 +0000 (11:00 +0200)
commit1ba226bd76e1d1c4ff2ed36a8c90cc725ed3b337
tree095a11bfc061d2e4cb0dcdcd0fab7877a99d7873
parenta64519b1f982ad4179f3973e43af2389b700f3bd
Fix one more exception handling issue

This change fixes exception handling issue that resulted in a finally block being invoked multiple
times in case of a rethrown exception in some specific cases.
The problem was caused by the ExceptionTracker::StackRange::CombineWith that was not handling
correctly the case when the current stack range was empty. It was copying only the upper limit
from the previous range and leaving the lower limit at the default (max) value.
This case happens in the interleaved exception handling when processing the first managed
frame after a block of native frames was unwound.
There is one additional fix in the UnwindManagedExceptionPass1 where we were popping one
frame from the thread's frame list before performing the native frames unwind. This was
not correct since in some cases, there can be more frames that need to be removed.
src/vm/exceptionhandling.cpp