瀏覽代碼

* 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 年之前
父節點
當前提交
7885f6c892
共有 1 個文件被更改,包括 7 次插入1 次删除
  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;