diff --git a/compiler/node.pas b/compiler/node.pas index 08fda1dfd2..a4955d6059 100644 --- a/compiler/node.pas +++ b/compiler/node.pas @@ -279,14 +279,11 @@ interface nf_ignore_for_wpo, { we know that this loadvmtaddrnode cannot be used to construct a class instance } { node is derived from generic parameter } - nf_generic_para - - { WARNING: there are now 32 elements in this type, and a set of this - type is written to the PPU. So before adding more elements, - either move some flags to specific nodes, or stream a normalset - to the ppu - } + nf_generic_para, + { internal flag to indicate that this node has been removed from the tree or must otherwise not be + execute. Running it through firstpass etc. will raise an internal error } + nf_do_not_execute ); tnodeflags = set of tnodeflag; @@ -777,7 +774,7 @@ implementation ppufile.getset(tppuset5(localswitches)); verbosity:=ppufile.getlongint; ppufile.getderef(resultdefderef); - ppufile.getset(tppuset4(flags)); + ppufile.getset(tppuset5(flags)); { updated by firstpass } expectloc:=LOC_INVALID; { updated by secondpass } @@ -792,7 +789,7 @@ implementation ppufile.putset(tppuset5(localswitches)); ppufile.putlongint(verbosity); ppufile.putderef(resultdefderef); - ppufile.putset(tppuset4(flags)); + ppufile.putset(tppuset5(flags)); end; @@ -1425,9 +1422,9 @@ begin { tvaroption must fit into a 4 byte set for speed reasons } if ord(high(tvaroption))>31 then internalerror(201110301); - { tnodeflags must fit into a 4 byte set for speed reasons } +(* { tnodeflags must fit into a 4 byte set for speed reasons } if ord(high(tnodeflags))>31 then - internalerror(2014020701); + internalerror(2014020701); *) {$pop} end. diff --git a/compiler/pass_1.pas b/compiler/pass_1.pas index 540db84e30..9951cbbb96 100644 --- a/compiler/pass_1.pas +++ b/compiler/pass_1.pas @@ -45,6 +45,7 @@ implementation globtype,comphook, globals, procinfo, + verbose, symdef {$ifdef extdebug} ,verbose,htypechk @@ -157,6 +158,7 @@ implementation begin if (nf_pass1_done in p.flags) then exit; + if not(nf_error in p.flags) then begin oldcodegenerror:=codegenerror; @@ -165,6 +167,11 @@ implementation oldverbosity:=status.verbosity; codegenerror:=false; repeat + { The error flag takes precedence over the 'do not execute' flag, + as its assumed the node tree isn't tenable beyond this point } + if (nf_do_not_execute in p.flags) then + InternalError(2022112401); + { checks make always a call } if ([cs_check_range,cs_check_overflow,cs_check_stack] * current_settings.localswitches <> []) then include(current_procinfo.flags,pi_do_call); diff --git a/compiler/pass_2.pas b/compiler/pass_2.pas index ad1cbc7a9d..565d373913 100644 --- a/compiler/pass_2.pas +++ b/compiler/pass_2.pas @@ -189,6 +189,11 @@ implementation internalerror(200208221); if not(nf_error in p.flags) then begin + { The error flag takes precedence over the 'do not execute' flag, + as its assumed the node tree isn't tenable beyond this point } + if (nf_do_not_execute in p.flags) then + InternalError(2022112402); + oldcodegenerror:=codegenerror; oldlocalswitches:=current_settings.localswitches; oldpos:=current_filepos; diff --git a/compiler/ppu.pas b/compiler/ppu.pas index 597ee27a34..eb5f8c8334 100644 --- a/compiler/ppu.pas +++ b/compiler/ppu.pas @@ -48,7 +48,7 @@ const CurrentPPUVersion = 208; { for any other changes to the ppu format, increase this version number (it's a cardinal) } - CurrentPPULongVersion = 17; + CurrentPPULongVersion = 18; { unit flags } uf_big_endian = $000004;