Browse Source

* make sure that int->int conversions are handled by the generic code
* handle class->interface conversions by JVM-specific code

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

Jonas Maebe 14 years ago
parent
commit
625f52b7e4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      compiler/jvm/njvmcnv.pas

+ 4 - 1
compiler/jvm/njvmcnv.pas

@@ -673,7 +673,10 @@ implementation
         toarrtype: char;
         toarrtype: char;
       begin
       begin
         resnode:=nil;
         resnode:=nil;
-        if not(convtype in [tc_equal,tc_int_2_int,tc_int_2_bool,tc_bool_2_int]) then
+        if not(convtype in [tc_equal,tc_int_2_int,tc_int_2_bool,tc_bool_2_int,tc_class_2_intf]) or
+           ((convtype in [tc_equal,tc_int_2_int,tc_bool_2_int,tc_int_2_bool]) and
+            ((left.resultdef.typ=orddef) and
+             (resultdef.typ=orddef))) then
           begin
           begin
             result:=false;
             result:=false;
             exit
             exit