Browse Source

* procedure version of fpc_copy to avoid errors with {$x-} (mantis #9918)

git-svn-id: trunk@8790 -
Jonas Maebe 18 years ago
parent
commit
dc71827e2e
5 changed files with 24 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/nld.pas
  3. 1 0
      rtl/inc/compproc.inc
  4. 9 0
      rtl/inc/rtti.inc
  5. 12 0
      tests/webtbs/tw9918.pp

+ 1 - 0
.gitattributes

@@ -8482,6 +8482,7 @@ tests/webtbs/tw9827.pp svneol=native#text/plain
 tests/webtbs/tw9894.pp svneol=native#text/plain
 tests/webtbs/tw9894a.pp svneol=native#text/plain
 tests/webtbs/tw9897.pp svneol=native#text/plain
+tests/webtbs/tw9918.pp svneol=native#text/plain
 tests/webtbs/tw9919.pp -text
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain

+ 1 - 1
compiler/nld.pas

@@ -609,7 +609,7 @@ implementation
                ccallparanode.create(ctypeconvnode.create_internal(
                  caddrnode.create_internal(right),voidpointertype),
                nil)));
-           result:=ccallnode.createintern('fpc_copy',hp);
+           result:=ccallnode.createintern('fpc_copy_proc',hp);
            left:=nil;
            right:=nil;
            exit;

+ 1 - 0
rtl/inc/compproc.inc

@@ -417,6 +417,7 @@ Procedure fpc_Addref (Data,TypeInfo : Pointer); compilerproc;
 Procedure fpc_DecRef (Data,TypeInfo : Pointer);  compilerproc;
 procedure fpc_finalize_array(data,typeinfo : pointer;count,size : longint); compilerproc;
 Function fpc_Copy (Src, Dest, TypeInfo : Pointer) : SizeInt; compilerproc;
+Procedure fpc_Copy_proc (Src, Dest, TypeInfo : Pointer); compilerproc; inline;
 {$endif FPC_HAS_FEATURE_RTTI}
 
 

+ 9 - 0
rtl/inc/rtti.inc

@@ -326,6 +326,15 @@ begin
 end;
 
 
+{ For internal use by the compiler, because otherwise $x- can cause trouble. }
+{ Generally disabling extended syntax checking for all compilerprocs may     }
+{ have unintended side-effects                                               }
+procedure fpc_Copy_proc (Src, Dest, TypeInfo : Pointer);compilerproc; inline;
+begin
+  fpc_copy_internal(src,dest,typeinfo);
+end;
+
+
 procedure fpc_finalize_array(data,typeinfo : pointer;count,size : longint); [Public,Alias:'FPC_FINALIZEARRAY'];  compilerproc;
   var
      i : longint;

+ 12 - 0
tests/webtbs/tw9918.pp

@@ -0,0 +1,12 @@
+{ %norun }
+{$x-}
+
+
+PROCEDURE Test;
+TYPE T = ARRAY OF Char;
+VAR V : T;
+BEGIN V := V;
+END;
+
+begin
+end.