Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
fix: BufferOverflowFastFailK.lib conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroKaku committed Jul 21, 2022
1 parent d4a16a1 commit 3e8e286
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions src/crt/i386/chandler4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ ValidateLocalCookies(
#if defined(_M_IX86) && !defined(CRTDLL) && !defined(_M_HYBRID)
// Filter incorrect x86 floating point exceptions, unless linkopt that provides an empty filter is available.
#pragma comment(linker, "/alternatename:__filter_x86_sse2_floating_point_exception=__filter_x86_sse2_floating_point_exception_default")
#pragma comment(linker, "/alternatename:__filter_x86_sse2_floating_point_exception_default=__UCXXRT__filter_x86_sse2_floating_point_exception_default")
#endif

DECLSPEC_GUARD_SUPPRESS
Expand Down
1 change: 1 addition & 0 deletions src/crt/i386/trnsctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ BEGIN_PRAGMA_OPTIMIZE_DISABLE("g", DOLPH:3322, "Uninvestigated issue from Visual
#if defined(_M_IX86) && !defined(CRTDLL) && !defined(_M_HYBRID)
// Filter incorrect x86 floating point exceptions, unless linkopt that provides an empty filter is available.
#pragma comment(linker, "/alternatename:__filter_x86_sse2_floating_point_exception=__filter_x86_sse2_floating_point_exception_default")
#pragma comment(linker, "/alternatename:__filter_x86_sse2_floating_point_exception_default=__UCXXRT__filter_x86_sse2_floating_point_exception_default")
#endif

__declspec(guard(ignore)) BOOL _CallSETranslator(
Expand Down
5 changes: 2 additions & 3 deletions src/crt/vcruntime/gs_cookie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ _CRT_BEGIN_C_HEADER
* initialize the cookie to the final value.
*/

//UINT_PTR __security_cookie = DEFAULT_SECURITY_COOKIE;
//
//UINT_PTR __security_cookie_complement = ~(DEFAULT_SECURITY_COOKIE);
DECLSPEC_SELECTANY UINT_PTR __security_cookie = DEFAULT_SECURITY_COOKIE;
DECLSPEC_SELECTANY UINT_PTR __security_cookie_complement = ~(DEFAULT_SECURITY_COOKIE);

_CRT_END_C_HEADER
5 changes: 4 additions & 1 deletion src/crt/vcruntime/gs_support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
*******************************************************************************/

#include <vcstartup_internal.h>

#if defined (_M_IX86) && defined (_CRTBLD) && defined (_DEBUG)
/*
Expand Down Expand Up @@ -158,7 +159,9 @@ static UINT_PTR __get_entropy(void)
*
*******************************************************************************/

void __cdecl __security_init_cookie(void)
_VCRT_DECLARE_ALTERNATE_NAME(__security_init_cookie, _UCXXRT___security_init_cookie);

void __cdecl _UCXXRT___security_init_cookie(void)
{
UINT_PTR cookie;

Expand Down
4 changes: 2 additions & 2 deletions src/crt/vcruntime/x86_exception_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#if defined(_M_IX86)

extern "C" long __CRTDECL _filter_x86_sse2_floating_point_exception_default(long const exception_code)
extern "C" long __CRTDECL _UCXXRT__filter_x86_sse2_floating_point_exception_default(long const exception_code)
{
// If we're using SSE2 instructions on x86, the OS exception trap does not correctly
// return accurate floating point exception codes.
Expand All @@ -29,7 +29,7 @@ extern "C" long __CRTDECL _filter_x86_sse2_floating_point_exception_default(long
if ( exception_code != STATUS_FLOAT_MULTIPLE_FAULTS
&& exception_code != STATUS_FLOAT_MULTIPLE_TRAPS) {
return exception_code;
}
}

// _mm_getcsr() (SSE2 fp status register 'mxcsr') format:
// Excpt Mask Excpt Set
Expand Down
8 changes: 4 additions & 4 deletions src/ucrt/misc/errno.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ int __cdecl __acrt_errno_from_os_error(long const oserrno)
}

// These safely set and get the value of the calling thread's errno
errno_t __cdecl _set_errno_default(_In_ int const value)
errno_t __cdecl _UCXXRT__set_errno(_In_ int const value)
{
errno = value;
return 0;
}

errno_t __cdecl _get_errno_default(_Out_ int* const result)
errno_t __cdecl _UCXXRT__get_errno(_Out_ int* const result)
{
_VALIDATE_RETURN_NOERRNO(result != nullptr, EINVAL);

Expand All @@ -103,8 +103,8 @@ errno_t __cdecl _get_errno_default(_Out_ int* const result)
return 0;
}

_VCRT_DECLARE_ALTERNATE_NAME(_set_errno, _set_errno_default);
_VCRT_DECLARE_ALTERNATE_NAME(_get_errno, _get_errno_default);
_VCRT_DECLARE_ALTERNATE_NAME(_set_errno, _UCXXRT__set_errno);
_VCRT_DECLARE_ALTERNATE_NAME(_get_errno, _UCXXRT__get_errno);

// These safely set and get the value of the calling thread's doserrno
errno_t __cdecl _set_doserrno(_In_ unsigned long const value)
Expand Down
18 changes: 9 additions & 9 deletions src/ucrt/misc/invalid_parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include <vcstartup_internal.h>


_VCRT_DECLARE_ALTERNATE_NAME(_invoke_watson, _invoke_watson_default);
_VCRT_DECLARE_ALTERNATE_NAME(_invoke_watson, _UCXXRT__invoke_watson);
#ifdef _DEBUG
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter, _invalid_parameter_default);
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter, _UCXXRT__invalid_parameter);
#endif
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter_noinfo, _invalid_parameter_noinfo_default);
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter_noinfo_noreturn, _invalid_parameter_noinfo_noreturn_default);
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter_noinfo, _UCXXRT__invalid_parameter_noinfo);
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter_noinfo_noreturn, _UCXXRT__invalid_parameter_noinfo_noreturn);


static _invalid_parameter_handler __acrt_invalid_parameter_handler;
Expand All @@ -32,7 +32,7 @@ extern "C" void __cdecl __acrt_initialize_invalid_parameter_handler(void* const
//
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

extern "C" void __cdecl _invalid_parameter_internal(
extern "C" static void __cdecl _invalid_parameter_internal(
wchar_t const* const expression,
wchar_t const* const function_name,
wchar_t const* const file_name,
Expand All @@ -57,7 +57,7 @@ extern "C" void __cdecl _invalid_parameter_internal(
_invoke_watson(expression, function_name, file_name, line_number, reserved);
}

extern "C" void __cdecl _invalid_parameter_default(
extern "C" void __cdecl _UCXXRT__invalid_parameter(
wchar_t const* const expression,
wchar_t const* const function_name,
wchar_t const* const file_name,
Expand All @@ -68,15 +68,15 @@ extern "C" void __cdecl _invalid_parameter_default(
return _invalid_parameter_internal(expression, function_name, file_name, line_number, reserved);
}

extern "C" void __cdecl _invalid_parameter_noinfo_default()
extern "C" void __cdecl _UCXXRT__invalid_parameter_noinfo()
{
_invalid_parameter_internal(nullptr, nullptr, nullptr, 0, 0);
}

// This is used by inline code in the C++ Standard Library and the SafeInt
// library. Because it is __declspec(noreturn), the compiler can better
// optimize use of the invalid parameter handler for inline code.
extern "C" __declspec(noreturn) void __cdecl _invalid_parameter_noinfo_noreturn_default()
extern "C" __declspec(noreturn) void __cdecl _UCXXRT__invalid_parameter_noinfo_noreturn()
{
_invalid_parameter_internal(nullptr, nullptr, nullptr, 0, 0);
_invoke_watson(nullptr, nullptr, nullptr, 0, 0);
Expand All @@ -89,7 +89,7 @@ extern "C" __declspec(noreturn) void __cdecl _invalid_parameter_noinfo_noreturn_
//
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

extern "C" __declspec(noreturn) void __cdecl _invoke_watson_default(
extern "C" __declspec(noreturn) void __cdecl _UCXXRT__invoke_watson(
wchar_t const* const expression,
wchar_t const* const function_name,
wchar_t const* const file_name,
Expand Down
5 changes: 1 addition & 4 deletions src/ucrt/misc/terminate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@

// fix: abort not implemented after 19043
// alternatename: https://devblogs.microsoft.com/oldnewthing/20200731-00/?p=104024

extern "C" void __cdecl _abort_default();
_VCRT_DECLARE_ALTERNATE_NAME(abort, _abort_default);

_VCRT_DECLARE_ALTERNATE_NAME(abort, _UCXXRT__abort);

static terminate_handler __cdecl get_terminate_or_default(
__acrt_ptd const* const ptd
Expand Down
2 changes: 1 addition & 1 deletion src/ucrt/startup/abort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern "C" unsigned int __abort_behavior = _INIT_ABORT_BEHAVIOR;
*
*******************************************************************************/

extern "C" void __cdecl _abort_default()
extern "C" void __cdecl _UCXXRT__abort()
{
#ifdef _DEBUG
if (__abort_behavior & _WRITE_ABORT_MSG)
Expand Down

0 comments on commit 3e8e286

Please sign in to comment.