浏览代码

Avoid calling compareword with maxi=0, as this generates an dynamic index range error when comiled with -CriotR option

Pierre Muller 5 月之前
父节点
当前提交
105382b8a1
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      compiler/widestr.pas

+ 2 - 1
compiler/widestr.pas

@@ -168,7 +168,8 @@ unit widestr;
          temp:=s2.len;
          if maxi>temp then
            maxi:=Temp;
-         temp:=compareword(s1.data[0],s2.data[0],maxi);
+         if maxi>0 then
+           temp:=compareword(s1.data[0],s2.data[0],maxi);
          if temp=0 then
            temp:=s1.len-s2.len;
          comparewidestrings:=temp;