aboutsummaryrefslogtreecommitdiff
path: root/src/lanes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lanes.cpp')
-rw-r--r--src/lanes.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp
index 126f65c..246e772 100644
--- a/src/lanes.cpp
+++ b/src/lanes.cpp
@@ -1559,11 +1559,12 @@ LUAG_FUNC( thread_index)
1559 break; 1559 break;
1560 } 1560 }
1561 // fall through if we are killed, as we got nil, "killed" on the stack 1561 // fall through if we are killed, as we got nil, "killed" on the stack
1562 [[fallthrough]];
1562 1563
1563 case DONE: // got regular return values 1564 case DONE: // got regular return values
1564 { 1565 {
1565 int i, nvalues = lua_gettop( L) - 3; 1566 int const nvalues{ lua_gettop(L) - 3 };
1566 for( i = nvalues; i > 0; -- i) 1567 for( int i = nvalues; i > 0; -- i)
1567 { 1568 {
1568 // pop the last element of the stack, to store it in the uservalue at its proper index 1569 // pop the last element of the stack, to store it in the uservalue at its proper index
1569 lua_rawseti( L, USR, i); 1570 lua_rawseti( L, USR, i);
@@ -2049,16 +2050,20 @@ static void EnableCrashingOnCrashes( void)
2049 const DWORD EXCEPTION_SWALLOWING = 0x1; 2050 const DWORD EXCEPTION_SWALLOWING = 0x1;
2050 2051
2051 HMODULE kernel32 = LoadLibraryA("kernel32.dll"); 2052 HMODULE kernel32 = LoadLibraryA("kernel32.dll");
2052 tGetPolicy pGetPolicy = (tGetPolicy)GetProcAddress(kernel32, "GetProcessUserModeExceptionPolicy"); 2053 if (kernel32)
2053 tSetPolicy pSetPolicy = (tSetPolicy)GetProcAddress(kernel32, "SetProcessUserModeExceptionPolicy");
2054 if( pGetPolicy && pSetPolicy)
2055 { 2054 {
2056 DWORD dwFlags; 2055 tGetPolicy pGetPolicy = (tGetPolicy) GetProcAddress(kernel32, "GetProcessUserModeExceptionPolicy");
2057 if( pGetPolicy( &dwFlags)) 2056 tSetPolicy pSetPolicy = (tSetPolicy) GetProcAddress(kernel32, "SetProcessUserModeExceptionPolicy");
2057 if (pGetPolicy && pSetPolicy)
2058 { 2058 {
2059 // Turn off the filter 2059 DWORD dwFlags;
2060 pSetPolicy( dwFlags & ~EXCEPTION_SWALLOWING); 2060 if (pGetPolicy(&dwFlags))
2061 {
2062 // Turn off the filter
2063 pSetPolicy(dwFlags & ~EXCEPTION_SWALLOWING);
2064 }
2061 } 2065 }
2066 FreeLibrary(kernel32);
2062 } 2067 }
2063 //typedef void (* SignalHandlerPointer)( int); 2068 //typedef void (* SignalHandlerPointer)( int);
2064 /*SignalHandlerPointer previousHandler =*/ signal( SIGABRT, signal_handler); 2069 /*SignalHandlerPointer previousHandler =*/ signal( SIGABRT, signal_handler);