From 0bf49d570bbb52e71b0e6760b63a6f3d157b7005 Mon Sep 17 00:00:00 2001 From: Margers Date: Mon, 10 Feb 2025 08:15:32 +0000 Subject: [PATCH] Symobl browser collect push on stack size without crash --- compiler/browcol.pas | 4 ++-- compiler/ctask.pas | 5 +++++ compiler/fmodule.pas | 3 ++- compiler/parser.pas | 6 ++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/compiler/browcol.pas b/compiler/browcol.pas index 571840e16c..5969c1bc67 100644 --- a/compiler/browcol.pas +++ b/compiler/browcol.pas @@ -272,9 +272,7 @@ implementation uses globtype,globals,comphook,constexp, -{$ifdef DEBUG} verbose, -{$endif DEBUG} finput,fmodule, crefs,cpuinfo,cgbase, aasmbase,aasmtai,aasmdata,paramgr, @@ -1763,6 +1761,8 @@ var ifile: sizeint; begin DisposeBrowserCol; + if not assigned(current_module.arraydefs) then + InternalError(2025021001); if (cs_browser in current_settings.moduleswitches) then NewBrowserCol; hp:=tmodule(loaded_units.first); diff --git a/compiler/ctask.pas b/compiler/ctask.pas index 41f54b1422..93a9f95a1d 100644 --- a/compiler/ctask.pas +++ b/compiler/ctask.pas @@ -282,6 +282,11 @@ begin parsing_done(m); if m.is_initial and not m.is_unit then m.state:=ms_processed; + end + else if (m.state=ms_processed) and m.is_initial and not m.is_unit then + begin + parsing_done(m); + m.state:=ms_processed; end; Result:=m.state=ms_processed; {$IFDEF DEBUG_CTASK} diff --git a/compiler/fmodule.pas b/compiler/fmodule.pas index 42b8e2b076..dabcfbab82 100644 --- a/compiler/fmodule.pas +++ b/compiler/fmodule.pas @@ -1289,8 +1289,9 @@ implementation localmacrosymtable:=nil; ptrdefs.free; ptrdefs:=nil; + { keep arraydefs for symbol browser needs arraydefs.free; - arraydefs:=nil; + arraydefs:=nil;} procaddrdefs.free; procaddrdefs:=nil; {$ifdef llvm} diff --git a/compiler/parser.pas b/compiler/parser.pas index decf036304..b601d3af85 100644 --- a/compiler/parser.pas +++ b/compiler/parser.pas @@ -62,13 +62,13 @@ implementation begin - module.end_of_parsing; - if (module.is_initial) and (status.errorcount=0) then { Write Browser Collections } do_extractsymbolinfo; + module.end_of_parsing; + // olddata.restore(false); { Restore all locally modified warning messages } @@ -517,8 +517,6 @@ implementation // if (module.is_initial) and not finished then // internalerror(2012091901); finally - if finished then - parsing_done(module); end; end;