Browse Source

* Save/restore high-level code generator when processing exception filters, fixes building in Win64 with -dTEST_WIN64_SEH, Mantis #21879.

git-svn-id: trunk@21110 -
sergei 13 years ago
parent
commit
a85bb08a74
1 changed files with 4 additions and 0 deletions
  1. 4 0
      compiler/psub.pas

+ 4 - 0
compiler/psub.pas

@@ -913,6 +913,7 @@ implementation
     procedure tcgprocinfo.generate_exceptfilter(nestedpi: tcgprocinfo);
       var
         saved_cg: tcg;
+        saved_hlcg: thlcgobj;
       begin
         if nestedpi.procdef.proctypeoption<>potype_exceptfilter then
           InternalError(201201141);
@@ -920,11 +921,14 @@ implementation
         aktproccode.concatlist(current_asmdata.CurrAsmList);
         { save the codegen }
         saved_cg:=cg;
+        saved_hlcg:=hlcg;
         cg:=nil;
+        hlcg:=nil;
         nestedpi.generate_code;
         { prevents generating code the second time when processing nested procedures }
         nestedpi.resetprocdef;
         cg:=saved_cg;
+        hlcg:=saved_hlcg;
         add_reg_instruction_hook:[email protected]_reg_instruction;
       end;