瀏覽代碼

+ Internalerror on encountering a variant array in a vecn.

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

+ 7 - 1
compiler/nmem.pas

@@ -722,7 +722,13 @@ implementation
          if (right.nodetype<>rangen) and (is_integer(right.resultdef) or (left.resultdef.typ<>arraydef)) then
          if (right.nodetype<>rangen) and (is_integer(right.resultdef) or (left.resultdef.typ<>arraydef)) then
            case left.resultdef.typ of
            case left.resultdef.typ of
              arraydef:
              arraydef:
-               if is_special_array(left.resultdef) then
+               if ado_isvariant in Tarraydef(left.resultdef).arrayoptions then
+                 {Variant arrays are a special array, can have negative indexes and would therefore
+                  need s32bit. However, they should not appear in a vecn, as they are handled in
+                  handle_variantarray in pexpr.pas. Therefore, encountering a variant array is an
+                  internal error... }
+                 internalerror(200707031)
+               else if is_special_array(left.resultdef) then
                  {Arrays without a high bound (dynamic arrays, open arrays) are zero based,
                  {Arrays without a high bound (dynamic arrays, open arrays) are zero based,
                   convert indexes into these arrays to aword.}
                   convert indexes into these arrays to aword.}
                  inserttypeconv(right,uinttype)
                  inserttypeconv(right,uinttype)