Selaa lähdekoodia

* give a generic "type mismatch" error if copy() is called with less than
3 parameters and none of the valid cases apply (mantis #13625)

git-svn-id: trunk@13070 -

Jonas Maebe 16 vuotta sitten
vanhempi
commit
7885f6c892
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      compiler/pinline.pas

+ 7 - 1
compiler/pinline.pas

@@ -766,7 +766,13 @@ implementation
          begin
          begin
            { generic fallback that will give an error if a wrong
            { generic fallback that will give an error if a wrong
              type is passed }
              type is passed }
-           copynode:=ccallnode.createintern('fpc_shortstr_copy',paras)
+           if (counter=3) then
+             copynode:=ccallnode.createintern('fpc_shortstr_copy',paras)
+           else
+             begin
+               CGMessagePos(ppn.left.fileinfo,type_e_mismatch);
+               copynode:=cerrornode.create;
+             end
          end;
          end;
 
 
         result.free;
         result.free;