瀏覽代碼

* disabled last safecall code for non-windows (mantis #12237)

git-svn-id: trunk@12021 -
Jonas Maebe 16 年之前
父節點
當前提交
7626a91592
共有 4 個文件被更改,包括 13 次插入1 次删除
  1. 1 0
      .gitattributes
  2. 2 1
      compiler/ncgcal.pas
  3. 1 0
      compiler/psub.pas
  4. 9 0
      tests/webtbs/tw12237.pp

+ 1 - 0
.gitattributes

@@ -8600,6 +8600,7 @@ tests/webtbs/tw1222.pp svneol=native#text/plain
 tests/webtbs/tw12224.pp svneol=native#text/plain
 tests/webtbs/tw1223.pp svneol=native#text/plain
 tests/webtbs/tw12233.pp svneol=native#text/plain
+tests/webtbs/tw12237.pp svneol=native#text/plain
 tests/webtbs/tw12242.pp svneol=native#text/plain
 tests/webtbs/tw12249.pp svneol=native#text/plain
 tests/webtbs/tw1228.pp svneol=native#text/plain

+ 2 - 1
compiler/ncgcal.pas

@@ -1105,7 +1105,8 @@ implementation
            end;
 
 {$if defined(x86) or defined(arm)}
-         if procdefinition.proccalloption=pocall_safecall then
+         if (procdefinition.proccalloption=pocall_safecall) and
+            (target_info.system in system_all_windows) then
            begin
 {$ifdef x86_64}
              cgpara.init;

+ 1 - 0
compiler/psub.pas

@@ -1063,6 +1063,7 @@ implementation
 {$if defined(x86) or defined(arm)}
             { Set return value of safecall procedure if implicit try/finally blocks are disabled }
             if not (cs_implicit_exceptions in current_settings.moduleswitches) and
+               (target_info.system in system_all_windows) and
                (procdef.proccalloption=pocall_safecall) then
               cg.a_load_const_reg(aktproccode,OS_ADDR,0,NR_FUNCTION_RETURN_REG);
 {$endif}

+ 9 - 0
tests/webtbs/tw12237.pp

@@ -0,0 +1,9 @@
+function f: longint; safecall;
+begin
+  f:=-2;
+end;
+
+begin
+  if (f<>-2) then
+    halt(1);
+end.