From 7885f6c892f4c84dc173006313bf8f0077039c81 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Fri, 1 May 2009 11:40:02 +0000 Subject: [PATCH] * 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 - --- compiler/pinline.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/pinline.pas b/compiler/pinline.pas index bed7566aa9..0c2da9f96e 100644 --- a/compiler/pinline.pas +++ b/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;