Przeglądaj źródła

* fix for Mantis #30205: (adjusted) patch by Do-wan Kim to only use the default calling convention for exception handlers
+ added test

git-svn-id: trunk@41277 -

svenbarth 6 lat temu
rodzic
commit
b1ee29c836
3 zmienionych plików z 17 dodań i 1 usunięć
  1. 1 0
      .gitattributes
  2. 4 1
      compiler/procdefutil.pas
  3. 12 0
      tests/webtbs/tw30205.pp

+ 1 - 0
.gitattributes

@@ -16242,6 +16242,7 @@ tests/webtbs/tw30179.pp svneol=native#text/pascal
 tests/webtbs/tw30182.pp svneol=native#text/plain
 tests/webtbs/tw30202.pp svneol=native#text/pascal
 tests/webtbs/tw30203.pp svneol=native#text/pascal
+tests/webtbs/tw30205.pp svneol=native#text/pascal
 tests/webtbs/tw30207.pp svneol=native#text/plain
 tests/webtbs/tw30208.pp svneol=native#text/pascal
 tests/webtbs/tw3023.pp svneol=native#text/plain

+ 4 - 1
compiler/procdefutil.pas

@@ -36,7 +36,7 @@ implementation
 
   uses
     cutils,
-    symbase,symsym,symtable,pparautl;
+    symbase,symsym,symtable,pparautl,globtype;
 
 
   function create_outline_procdef(const basesymname: string; astruct: tabstractrecorddef; potype: tproctypeoption; resultdef: tdef): tprocdef;
@@ -72,6 +72,9 @@ implementation
         nested procvars modeswitch is active. We must be independent of this switch. }
       exclude(result.procoptions,po_delphi_nested_cc);
       result.proctypeoption:=potype;
+      { always use the default calling convention }
+      result.proccalloption:=pocall_default;
+      include(result.procoptions,po_hascallingconvention);
       handle_calling_convention(result,hcc_default_actions_impl);
       sym:=cprocsym.create(basesymname+result.unique_id_str);
       st.insert(sym);

+ 12 - 0
tests/webtbs/tw30205.pp

@@ -0,0 +1,12 @@
+{ %TARGET=win32 }
+program tw30205;
+{$calling cdecl}
+procedure ietest( var f: ansistring );
+var
+  x: ansistring;
+begin
+  x :='1234';
+  f := x;
+end;
+begin
+end.