Skip to content

Commit

Permalink
8317132: Prepare HotSpot for permissive-
Browse files Browse the repository at this point in the history
Reviewed-by: dholmes, jvernee, djelinski
  • Loading branch information
TheShermanTanker committed Nov 2, 2023
1 parent 5207443 commit 4a85f6a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
# The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
# compilation of all source files regardless of the active code page on Windows.
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -utf-8 -MP"
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -permissive- -utf-8 -MP"
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -utf-8 -Zc:wchar_t-"
fi
Expand Down
23 changes: 12 additions & 11 deletions src/hotspot/os/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2256,7 +2256,7 @@ void* os::win32::install_signal_handler(int sig, signal_handler_t handler) {
sigbreakHandler = handler;
return oldHandler;
} else {
return ::signal(sig, handler);
return CAST_FROM_FN_PTR(void*, ::signal(sig, handler));
}
}

Expand Down Expand Up @@ -2909,22 +2909,23 @@ LONG WINAPI topLevelVectoredExceptionFilter(struct _EXCEPTION_POINTERS* exceptio

#if defined(USE_VECTORED_EXCEPTION_HANDLING)
LONG WINAPI topLevelUnhandledExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
if (InterceptOSException) goto exit;
DWORD exception_code = exceptionInfo->ExceptionRecord->ExceptionCode;
if (!InterceptOSException) {
DWORD exceptionCode = exceptionInfo->ExceptionRecord->ExceptionCode;
#if defined(_M_ARM64)
address pc = (address)exceptionInfo->ContextRecord->Pc;
address pc = (address) exceptionInfo->ContextRecord->Pc;
#elif defined(_M_AMD64)
address pc = (address) exceptionInfo->ContextRecord->Rip;
address pc = (address) exceptionInfo->ContextRecord->Rip;
#else
address pc = (address) exceptionInfo->ContextRecord->Eip;
address pc = (address) exceptionInfo->ContextRecord->Eip;
#endif
Thread* t = Thread::current_or_null_safe();
Thread* thread = Thread::current_or_null_safe();

if (exception_code != EXCEPTION_BREAKPOINT) {
report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord,
exceptionInfo->ContextRecord);
if (exceptionCode != EXCEPTION_BREAKPOINT) {
report_error(thread, exceptionCode, pc, exceptionInfo->ExceptionRecord,
exceptionInfo->ContextRecord);
}
}
exit:

return previousUnhandledExceptionFilter ? previousUnhandledExceptionFilter(exceptionInfo) : EXCEPTION_CONTINUE_SEARCH;
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os/windows/symbolengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class SimpleBufferWithFallback {
_p = _fallback_buffer;
_capacity = (int)(sizeof(_fallback_buffer) / sizeof(T));
}
_p[0] = '\0';
_p[0] = 0;
imprint_sentinel();
}

Expand All @@ -123,7 +123,7 @@ class SimpleBufferWithFallback {
}
_p = _fallback_buffer;
_capacity = (int)(sizeof(_fallback_buffer) / sizeof(T));
_p[0] = '\0';
_p[0] = 0;
imprint_sentinel();
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/memory/allocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void* ArenaObj::operator new(size_t size, Arena *arena) throw() {
// AnyObj
//

void* AnyObj::operator new(size_t size, Arena *arena) throw() {
void* AnyObj::operator new(size_t size, Arena *arena) {
address res = (address)arena->Amalloc(size);
DEBUG_ONLY(set_allocation_type(res, ARENA);)
return res;
Expand Down

1 comment on commit 4a85f6a

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.