Browse Source

* Calling "internalstatements" now sets the "bnf_strippable" flag on the result

J. Gareth "Curious Kit" Moreton 1 year ago
parent
commit
5a9d4d44fa
2 changed files with 4 additions and 1 deletions
  1. 2 1
      compiler/nbas.pas
  2. 2 0
      compiler/psub.pas

+ 2 - 1
compiler/nbas.pas

@@ -383,7 +383,8 @@ implementation
       begin
         { create dummy initial statement }
         laststatement := cstatementnode.create(cnothingnode.create,nil);
-        internalstatements := cblocknode.create(laststatement);
+        result := cblocknode.create(laststatement);
+        Include(result.blocknodeflags, bnf_strippable);
       end;
 
 

+ 2 - 0
compiler/psub.pas

@@ -908,6 +908,8 @@ implementation
           an try...finally...end wrapper }
         current_filepos:=entrypos;
         newblock:=internalstatements(newstatement);
+        { Note - this is not strippable since it wraps the entire procedure }
+        Exclude(TBlockNode(newblock).blocknodeflags, bnf_strippable);
         { initialization is common for all cases }
         addstatement(newstatement,loadpara_asmnode);
         addstatement(newstatement,stackcheck_asmnode);