Explorar o código

* fixed (not harmless) class cast error when indexing an array[orddef] using
a non-orddef (e.g., a variant)

git-svn-id: trunk@21261 -

Jonas Maebe %!s(int64=13) %!d(string=hai) anos
pai
achega
11e9f95580
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      compiler/nmem.pas

+ 3 - 0
compiler/nmem.pas

@@ -857,6 +857,9 @@ implementation
                                                       asizeint(Tarraydef(left.resultdef).highrange)
                                                      ))
                  else if (htype.typ=orddef) and
+                    { right can also be a variant or another type with
+                      overloaded assignment }
+                    (right.resultdef.typ=orddef) and
                     { don't try to create boolean types with custom ranges }
                     not is_boolean(right.resultdef) and
                     { ordtype determines the size of the loaded value -> make