浏览代码

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

git-svn-id: trunk@9758 -
peter 17 年之前
父节点
当前提交
923aac0390
共有 1 个文件被更改,包括 2 次插入0 次删除
  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? }
      { not assigned yet? }
      if not(assigned(p)) then
      if not(assigned(p)) then
        begin
        begin
+          if dims[dimcount-1]<0 then
+            HandleErrorFrame(201,get_frame);
           { do we have to allocate memory? }
           { do we have to allocate memory? }
           if dims[dimcount-1] = 0 then
           if dims[dimcount-1] = 0 then
             exit;
             exit;