Browse Source

* don't insert checkcast operations for types that are considered to be
te_equal

git-svn-id: branches/jvmbackend@18529 -

Jonas Maebe 14 years ago
parent
commit
b8f6c42ec7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/jvm/njvmcnv.pas

+ 3 - 2
compiler/jvm/njvmcnv.pas

@@ -494,8 +494,9 @@ implementation
             get_most_nested_types(fromdef,todef);
             fromarrtype:=jvmarrtype_setlength(fromdef);
             toarrtype:=jvmarrtype_setlength(todef);
-            if not fromdef.is_related(todef) and
-               (((fromdef.typ<>objectdef) and
+            if (compare_defs(fromdef,todef,nothingn)<te_equal) and
+               not fromdef.is_related(todef) and
+               (((fromdef.typ in [objectdef,recorddef,stringdef]) and
                  not is_dynamic_array(fromdef)) or
                 (todef<>java_jlobject)) and
                ((fromarrtype in ['A','R']) or