P4 to Git Change 1104653 by jsjodin@jsjodin_linux_avx_hsa on 2014/12/11 13:21:54

EPR #411189 - Fix windows handling of SIGFPE. We cannot check worker thread during creation, because the constructor has not yet been called.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/os/os_win32.cpp#43 edit


[ROCm/clr commit: 5a2d6ed3c7]
This commit is contained in:
foreman
2014-12-11 13:28:22 -05:00
parent 0293e30a65
commit 65ccc231df
+11 -15
View File
@@ -450,9 +450,9 @@ divExceptionFilter(struct _EXCEPTION_POINTERS* ep)
{
DWORD code = ep->ExceptionRecord->ExceptionCode;
if (code == EXCEPTION_INT_DIVIDE_BY_ZERO ||
code == EXCEPTION_INT_OVERFLOW) {
if ((code == EXCEPTION_INT_DIVIDE_BY_ZERO ||
code == EXCEPTION_INT_OVERFLOW) &&
Thread::current()->isWorkerThread()) {
address insn = (address)ep->ContextRecord->LP64_SWITCH(Eip,Rip);
if (Os::skipIDIV(insn)) {
@@ -468,20 +468,16 @@ Thread::entry(Thread* thread)
{
void* ret = NULL;
#if !defined(_WIN64)
if (thread->isWorkerThread()) {
__try {
ret = thread->main();
}
__except(divExceptionFilter(GetExceptionInformation())) {
// nothing to do here.
}
}
else {
#else // _WIN64
{
#endif // _WIN64
__try {
ret = thread->main();
}
__except(divExceptionFilter(GetExceptionInformation())) {
// nothing to do here.
}
#else // _WIN64
ret = thread->main();
#endif // _WIN64
// The current thread exits, thus clear the pointer
#if defined(USE_DECLSPEC_THREAD)
details::thread_ = NULL;