mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 21:29:19 +02:00
* use only windows exceptions for stack checking on win32/win64, resolves #9166
git-svn-id: trunk@9020 -
This commit is contained in:
parent
986396545d
commit
90af7ebf72
@ -1986,6 +1986,12 @@ begin
|
||||
else
|
||||
def_system_macro('FPC_CPUCROSSCOMPILING');
|
||||
|
||||
if (tf_no_generic_stackcheck in target_info.flags) then
|
||||
if def then
|
||||
def_system_macro('FPC_NO_GENERIC_STACK_CHECK')
|
||||
else
|
||||
undef_system_macro('FPC_NO_GENERIC_STACK_CHECK');
|
||||
|
||||
{ Code generation flags }
|
||||
if def and
|
||||
(tf_pic_default in target_info.flags) then
|
||||
|
@ -996,7 +996,8 @@ implementation
|
||||
|
||||
{ Already reserve all registers for stack checking code and
|
||||
generate the call to the helper function }
|
||||
if (cs_check_stack in entryswitches) and
|
||||
if not(tf_no_generic_stackcheck in target_info.flags) and
|
||||
(cs_check_stack in entryswitches) and
|
||||
not(po_assembler in procdef.procoptions) and
|
||||
(procdef.proctypeoption<>potype_proginit) then
|
||||
begin
|
||||
|
@ -312,7 +312,9 @@ interface
|
||||
tf_dwarf_only_local_labels, // only use local labels inside the Dwarf debug_info section (needed for e.g. Darwin)
|
||||
tf_requires_proper_alignment,
|
||||
tf_no_pic_supported,
|
||||
tf_pic_default
|
||||
tf_pic_default,
|
||||
{ the os does some kind of stack checking and it can be converted into a rte 202 }
|
||||
tf_no_generic_stackcheck
|
||||
);
|
||||
|
||||
psysteminfo = ^tsysteminfo;
|
||||
|
@ -33,7 +33,9 @@ unit i_win;
|
||||
name : 'Win32 for i386';
|
||||
shortname : 'Win32';
|
||||
flags : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses,tf_smartlink_library
|
||||
,tf_smartlink_sections{,tf_section_threadvars}{,tf_needs_dwarf_cfi},tf_winlikewidestring,tf_no_pic_supported];
|
||||
,tf_smartlink_sections{,tf_section_threadvars}{,tf_needs_dwarf_cfi},
|
||||
tf_winlikewidestring,tf_no_pic_supported,
|
||||
tf_no_generic_stackcheck];
|
||||
cpu : cpu_i386;
|
||||
unit_env : 'WIN32UNITS';
|
||||
extradefines : 'MSWINDOWS;WINDOWS';
|
||||
@ -93,7 +95,8 @@ unit i_win;
|
||||
name : 'Win64 for x64';
|
||||
shortname : 'Win64';
|
||||
flags : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses,
|
||||
tf_smartlink_sections,tf_smartlink_library,tf_winlikewidestring,tf_no_pic_supported];
|
||||
tf_smartlink_sections,tf_smartlink_library,tf_winlikewidestring,tf_no_pic_supported,
|
||||
tf_no_generic_stackcheck];
|
||||
cpu : cpu_x86_64;
|
||||
unit_env : 'WIN64UNITS';
|
||||
extradefines : 'MSWINDOWS;WINDOWS';
|
||||
|
@ -653,6 +653,11 @@ end;
|
||||
Stack check code
|
||||
*****************************************************************************}
|
||||
|
||||
{ be compatible with old code }
|
||||
{$ifdef FPC_NO_GENERIC_STACK_CHECK}
|
||||
{$define NO_GENERIC_STACK_CHECK}
|
||||
{$endif FPC_NO_GENERIC_STACK_CHECK}
|
||||
|
||||
{$IFNDEF NO_GENERIC_STACK_CHECK}
|
||||
|
||||
{$IFOPT S+}
|
||||
|
@ -1109,11 +1109,11 @@ begin
|
||||
StackBottom := StackTop - StackLength;
|
||||
{ get some helpful informations }
|
||||
GetStartupInfo(@startupinfo);
|
||||
|
||||
SysResetFPU;
|
||||
|
||||
SysResetFPU;
|
||||
if not(IsLibrary) then
|
||||
SysInitFPU;
|
||||
|
||||
|
||||
{ some misc Win32 stuff }
|
||||
hprevinst:=0;
|
||||
if not IsLibrary then
|
||||
|
Loading…
Reference in New Issue
Block a user