Explorar o código

* 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 %!s(int64=16) %!d(string=hai) anos
pai
achega
7885f6c892
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      compiler/pinline.pas

+ 7 - 1
compiler/pinline.pas

@@ -766,7 +766,13 @@ implementation
          begin
            { generic fallback that will give an error if a wrong
              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;
 
         result.free;