瀏覽代碼

* 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 年之前
父節點
當前提交
625f52b7e4
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      compiler/jvm/njvmcnv.pas

+ 4 - 1
compiler/jvm/njvmcnv.pas

@@ -673,7 +673,10 @@ implementation
         toarrtype: char;
       begin
         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
             result:=false;
             exit