Browse Source

+ allow jumps to goto targets

Nikolay Nikolov 1 year ago
parent
commit
b1cec6de2a
3 changed files with 6 additions and 0 deletions
  1. 3 0
      compiler/aasmbase.pas
  2. 1 0
      compiler/wasm32/cgcpu.pas
  3. 2 0
      compiler/wasm32/hlcgcpu.pas

+ 3 - 0
compiler/aasmbase.pas

@@ -239,6 +239,9 @@ interface
          is_set    : boolean;
          is_public : boolean;
          defined_in_asmstatement : boolean;
+{$ifdef wasm32}
+         is_pascal_goto_target: boolean;
+{$endif wasm32}
          constructor Createlocal(AList: TFPHashObjectList; nr: longint; ltyp: TAsmLabelType);
          constructor Createstatic(AList: TFPHashObjectList; nr: longint; ltyp: TAsmLabelType);
          constructor Createglobal(AList: TFPHashObjectList; const modulename: TSymStr; nr: longint; ltyp: TAsmLabelType);

+ 1 - 0
compiler/wasm32/cgcpu.pas

@@ -147,6 +147,7 @@ implementation
         lbl: tai_label;
       begin
         lbl:=tai_label.create(l);
+        l.is_pascal_goto_target:=true;
         lbl.is_pascal_goto_target:=true;
         list.concat(lbl);
       end;

+ 2 - 0
compiler/wasm32/hlcgcpu.pas

@@ -1925,6 +1925,8 @@ implementation
         list.concat(taicpu.op_sym(a_br,l))
       else if l=current_procinfo.CurrExitLabel then
         list.concat(taicpu.op_sym(a_br,l))
+      else if l.is_pascal_goto_target then
+        list.concat(taicpu.op_sym(a_br,l))
       else
         begin
 {$ifndef EXTDEBUG}