Explorar o código

* give range error if setlength value < 0 and the array is not filled

git-svn-id: trunk@9758 -
peter %!s(int64=17) %!d(string=hai) anos
pai
achega
923aac0390
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      rtl/inc/dynarr.inc

+ 2 - 0
rtl/inc/dynarr.inc

@@ -169,6 +169,8 @@ procedure fpc_dynarray_setlength(var p : pointer;pti : pointer;
      { not assigned yet? }
      if not(assigned(p)) then
        begin
+          if dims[dimcount-1]<0 then
+            HandleErrorFrame(201,get_frame);
           { do we have to allocate memory? }
           if dims[dimcount-1] = 0 then
             exit;