瀏覽代碼

* fixed wrong range check warnings/errors for open strings

git-svn-id: trunk@7944 -
Jonas Maebe 18 年之前
父節點
當前提交
ce478cd249
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      compiler/nmem.pas

+ 3 - 1
compiler/nmem.pas

@@ -739,7 +739,9 @@ implementation
                                                      int64(Tarraydef(left.resultdef).highrange)
                                                     ));
              stringdef:
-               if Tstringdef(left.resultdef).stringtype=st_shortstring then
+               if is_open_string(left.resultdef) then
+                 inserttypeconv(right,u8inttype)
+               else if is_shortstring(left.resultdef) then
                  {Convert shortstring indexes to 0..length.}
                  inserttypeconv(right,Torddef.create(u8bit,0,int64(Tstringdef(left.resultdef).len)))
                else