Browse Source

* fixed type conversions between signed and unsigned ordinals of the same
size when stored in memory

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

Jonas Maebe 14 years ago
parent
commit
94be1980b4
1 changed files with 5 additions and 6 deletions
  1. 5 6
      compiler/jvm/njvmcnv.pas

+ 5 - 6
compiler/jvm/njvmcnv.pas

@@ -346,16 +346,15 @@ implementation
           end
           end
         else
         else
           begin
           begin
-            location_copy(location,left.location);
-            location.size:=def_cgsize(resultdef);
             if (ressize < sizeof(aint)) and
             if (ressize < sizeof(aint)) and
-               (location.loc in [LOC_REGISTER,LOC_CREGISTER]) and
                (def_cgsize(left.resultdef)<>def_cgsize(resultdef)) then
                (def_cgsize(left.resultdef)<>def_cgsize(resultdef)) then
               begin
               begin
+                location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
                 location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,resultdef);
                 location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,resultdef);
-                location.loc:=LOC_REGISTER;
-                hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,left.resultdef,resultdef,left.location.register,location.register);
-              end;
+                hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,left.resultdef,resultdef,left.location,location.register);
+              end
+            else
+              location_copy(location,left.location);
           end;
           end;
       end;
       end;