Browse Source

* synchronized with trunk

git-svn-id: branches/wasm@47778 -
nickysn 4 years ago
parent
commit
47ff701db7
5 changed files with 27 additions and 8 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/aarch64/agcpugas.pas
  3. 2 3
      compiler/psub.pas
  4. 0 4
      rtl/inc/system.inc
  5. 23 0
      tests/webtbs/tw38201.pp

+ 1 - 0
.gitattributes

@@ -18644,6 +18644,7 @@ tests/webtbs/tw3814.pp svneol=native#text/plain
 tests/webtbs/tw38145a.pp svneol=native#text/pascal
 tests/webtbs/tw38145a.pp svneol=native#text/pascal
 tests/webtbs/tw38145b.pp svneol=native#text/pascal
 tests/webtbs/tw38145b.pp svneol=native#text/pascal
 tests/webtbs/tw38151.pp svneol=native#text/pascal
 tests/webtbs/tw38151.pp svneol=native#text/pascal
+tests/webtbs/tw38201.pp svneol=native#text/pascal
 tests/webtbs/tw38202.pp svneol=native#text/pascal
 tests/webtbs/tw38202.pp svneol=native#text/pascal
 tests/webtbs/tw3827.pp svneol=native#text/plain
 tests/webtbs/tw3827.pp svneol=native#text/plain
 tests/webtbs/tw3829.pp svneol=native#text/plain
 tests/webtbs/tw3829.pp svneol=native#text/plain

+ 1 - 1
compiler/aarch64/agcpugas.pas

@@ -229,7 +229,7 @@ unit agcpugas;
                   begin
                   begin
                     check_offset(seh.data.offset,512);
                     check_offset(seh.data.offset,512);
                     check_reg(seh.data.reg,R_MMREGISTER,min_mm_reg);
                     check_reg(seh.data.reg,R_MMREGISTER,min_mm_reg);
-                    writeword($DA00 or ((getsupreg(seh.data.reg)-min_int_reg) shl 6) or ((seh.data.offset shr 3)-1));
+                    writeword($DA00 or ((getsupreg(seh.data.reg)-min_mm_reg) shl 6) or ((seh.data.offset shr 3)-1));
                   end;
                   end;
                 else
                 else
                   internalerror(2020041503);
                   internalerror(2020041503);

+ 2 - 3
compiler/psub.pas

@@ -1136,9 +1136,8 @@ implementation
                   { parasize must be really zero, this means also that no result may be returned
                   { parasize must be really zero, this means also that no result may be returned
                     in a parameter }
                     in a parameter }
                   and not((current_procinfo.procdef.proccalloption in clearstack_pocalls) and
                   and not((current_procinfo.procdef.proccalloption in clearstack_pocalls) and
-                    not(current_procinfo.procdef.generate_safecall_wrapper) and
-                    paramanager.ret_in_param(current_procinfo.procdef.returndef,current_procinfo.procdef))
-                   {and (para_stack_size=0)} then
+                  not(current_procinfo.procdef.generate_safecall_wrapper) and
+                  paramanager.ret_in_param(current_procinfo.procdef.returndef,current_procinfo.procdef)) then
                   begin
                   begin
                     { Only need to set the framepointer }
                     { Only need to set the framepointer }
                     framepointer:=NR_STACK_POINTER_REG;
                     framepointer:=NR_STACK_POINTER_REG;

+ 0 - 4
rtl/inc/system.inc

@@ -1327,10 +1327,6 @@ begin
   errorcode:=word(Errno);
   errorcode:=word(Errno);
   erroraddr:=addr;
   erroraddr:=addr;
   errorbase:=frame;
   errorbase:=frame;
-{$ifdef FPC_HAS_FEATURE_EXCEPTIONS}
-  if ExceptAddrStack <> nil then
-    raise TObject(nil) at addr,frame;
-{$endif FPC_HAS_FEATURE_EXCEPTIONS}
   Halt(errorcode);
   Halt(errorcode);
 end;
 end;
 
 

+ 23 - 0
tests/webtbs/tw38201.pp

@@ -0,0 +1,23 @@
+{ %result=201 }
+program Test;
+{$apptype console}
+{$ifdef fpc}
+{$mode objfpc}
+{$endif fpc}
+{$R+}
+
+var
+  Arr: array[1..2] of integer;
+  i: Integer;
+begin
+  i:=5;
+  try
+    try
+      Arr[i] := 1;
+    except
+      writeln('Except block');
+    end;
+  finally
+    writeln('Finally block');
+  end;
+end.