浏览代码

* Merge 6961 and 6994.

git-svn-id: branches/fixes_2_2@6997 -
daniel 18 年之前
父节点
当前提交
f7f07e518e
共有 3 个文件被更改,包括 10 次插入5 次删除
  1. 6 1
      compiler/ncal.pas
  2. 3 3
      rtl/linux/ossysc.inc
  3. 1 1
      rtl/unix/oscdeclh.inc

+ 6 - 1
compiler/ncal.pas

@@ -606,18 +606,23 @@ implementation
                         end;
                       {In the procedure the array range is 0..(upper_bound-lower_bound).}
                       hightree:=caddnode.create(subn,r,l);
-                      typecheckpass(hightree);
 
                       {Replace the rangnode in the tree by its lower_bound, and
                        dispose the rangenode.}
                       temp:=Tvecnode(p).right;
                       Tvecnode(p).right:=l.getcopy;
+
+					  {Typecheckpass can only be performed *after* the l.getcopy since it
+                       can modify the tree, and l is in the hightree.}
+                      typecheckpass(hightree);
+
                       with Trangenode(temp) do
                         begin
                           left:=nil;
                           right:=nil;
                         end;
                       temp.free;
+
                       {Tree changed from p[l..h] to p[l], recalculate resultdef.}
                       p.resultdef:=nil;
                       typecheckpass(p);

+ 3 - 3
rtl/linux/ossysc.inc

@@ -179,7 +179,7 @@ begin
         dirp^.dd_size := bytes;
         dirp^.dd_nextoff := 0;
       end;
-    dp := pdirent(ptrint(dirp^.dd_buf)+dirp^.dd_nextoff);
+    dp := Pdirent(ptruint(dirp^.dd_buf)+dirp^.dd_nextoff);
     inc(dirp^.dd_nextoff,dp^.d_reclen);
     inc(dirp^.dd_loc,dp^.d_reclen);
   until dp^.d_fileno <> 0; // Don't show deleted files
@@ -271,7 +271,7 @@ function Fpsigaction(sig: cint; new_action, old_action: psigactionrec): cint; [p
 begin
 {$ifdef cpusparc}
   { Sparc has an extra stub parameter }
-  Fpsigaction:=do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(new_action),TSysParam(old_action),TSysParam(PtrInt(@Fprt_sigreturn_stub)-8),TSysParam(8));
+  Fpsigaction:=do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(new_action),TSysParam(old_action),TSysParam(ptruint(@Fprt_sigreturn_stub)-8),TSysParam(8));
 {$else cpusparc}
 {$ifdef NEED_USER_TRAMPOLINE}
   if new_action <> nil then
@@ -582,7 +582,7 @@ end;
 
 {$if defined(cpupowerpc)}
 { fpprctl() call }
-function fpprctl(option : cint; const arg : ptrint) : cint;
+function fpprctl(option : cint; const arg : ptruint) : cint;
 begin
   fpprctl := do_syscall(syscall_nr_prctl, option, arg);
 end;

+ 1 - 1
rtl/unix/oscdeclh.inc

@@ -133,5 +133,5 @@ const
     function  FpWriteV	   (fd: cint; const iov : piovec; iovcnt : cint):TSSize;  cdecl; external clib name 'writev';
 
 {$ifdef linux}
-    function  FpPrCtl(options : cInt; const args : ptrint) : cint; cdecl; external clib name 'prctl';
+    function  FpPrCtl(options : cInt; const args : ptruint) : cint; cdecl; external clib name 'prctl';
 {$endif}