summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonghyun Park <parjong@gmail.com>2017-03-13 20:47:08 +0900
committerJan Kotas <jkotas@microsoft.com>2017-03-13 04:47:08 -0700
commit537a4529758d44352bcd02657e42c49385f3950f (patch)
tree750a3fc5c76990da6c88d8cbef14fb45299bd94e /src
parent4797035df287ee02ac46e9e2c93c2db5a62dbee7 (diff)
downloadcoreclr-537a4529758d44352bcd02657e42c49385f3950f.tar.gz
coreclr-537a4529758d44352bcd02657e42c49385f3950f.tar.bz2
coreclr-537a4529758d44352bcd02657e42c49385f3950f.zip
Use VSD_STUB_CAN_THROW_AV instead of explicit _TARGET_XXX_ (#10143)
Diffstat (limited to 'src')
-rw-r--r--src/vm/exceptionhandling.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/vm/exceptionhandling.cpp b/src/vm/exceptionhandling.cpp
index 8419442b95..e4ac6897cf 100644
--- a/src/vm/exceptionhandling.cpp
+++ b/src/vm/exceptionhandling.cpp
@@ -21,6 +21,10 @@
#define USE_CURRENT_CONTEXT_IN_FILTER
#endif // _TARGET_X86_
+#if defined(_TARGET_ARM_) || defined(__TARGET_X86_)
+#define VSD_STUB_CAN_THROW_AV
+#endif // _TARGET_ARM_ || _TARGET_X86_
+
#if defined(_TARGET_ARM_) || defined(_TARGET_ARM64_) || defined(_TARGET_X86_)
#define ADJUST_PC_UNWOUND_TO_CALL
#define STACK_RANGE_BOUNDS_ARE_CALLER_SP
@@ -5087,7 +5091,7 @@ BOOL IsSafeToCallExecutionManager()
GCStress<cfg_instr_ngen>::IsEnabled();
}
-#if defined(_TARGET_ARM_) || defined(_TARGET_X86_)
+#ifdef VSD_STUB_CAN_THROW_AV
//Return TRUE if pContext->Pc is in VirtualStub
static BOOL IsIPinVirtualStub(PCODE f_IP)
{
@@ -5118,7 +5122,7 @@ static BOOL IsIPinVirtualStub(PCODE f_IP)
return FALSE;
}
}
-#endif
+#endif // VSD_STUB_CAN_THROW_AV
BOOL IsSafeToHandleHardwareException(PCONTEXT contextRecord, PEXCEPTION_RECORD exceptionRecord)
{
@@ -5127,9 +5131,9 @@ BOOL IsSafeToHandleHardwareException(PCONTEXT contextRecord, PEXCEPTION_RECORD e
exceptionRecord->ExceptionCode == STATUS_BREAKPOINT ||
exceptionRecord->ExceptionCode == STATUS_SINGLE_STEP ||
(IsSafeToCallExecutionManager() && ExecutionManager::IsManagedCode(controlPc)) ||
-#if defined(_TARGET_ARM_) || defined(_TARGET_X86_)
+#ifdef VSD_STUB_CAN_THROW_AV
IsIPinVirtualStub(controlPc) || // access violation comes from DispatchStub of Interface call
-#endif
+#endif // VSD_STUB_CAN_THROW_AV
IsIPInMarkedJitHelper(controlPc));
}
@@ -5178,12 +5182,12 @@ BOOL HandleHardwareException(PAL_SEHException* ex)
PAL_VirtualUnwind(ex->GetContextRecord(), NULL);
ex->GetExceptionRecord()->ExceptionAddress = (PVOID)GetIP(ex->GetContextRecord());
}
-#if defined(_TARGET_ARM_) || defined(_TARGET_X86_)
+#ifdef VSD_STUB_CAN_THROW_AV
else if (IsIPinVirtualStub(controlPc))
{
AdjustContextForVirtualStub(ex->GetExceptionRecord(), ex->GetContextRecord());
}
-#endif
+#endif // VSD_STUB_CAN_THROW_AV
fef.InitAndLink(ex->GetContextRecord());
}