浏览代码

* prevent internal errors when calling location_force_mem() for
dynamic or open arrays on the JVM target

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

Jonas Maebe 14 年之前
父节点
当前提交
c648cade1a
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      compiler/hlcgobj.pas

+ 7 - 1
compiler/hlcgobj.pas

@@ -1935,6 +1935,7 @@ implementation
   procedure thlcgobj.location_force_mem(list: TAsmList; var l: tlocation; size: tdef);
     var
       r : treference;
+      forcesize: aint;
     begin
       case l.loc of
         LOC_FPUREGISTER,
@@ -1959,7 +1960,12 @@ implementation
         LOC_REGISTER,
         LOC_CREGISTER :
           begin
-            tg.gethltemp(list,size,size.size,tt_normal,r);
+            if not is_dynamic_array(size) and
+               not is_open_array(size) then
+              forcesize:=size.size
+            else
+              forcesize:=voidpointertype.size;
+            tg.gethltemp(list,size,forcesize,tt_normal,r);
             a_load_loc_ref(list,size,size,l,r);
             location_reset_ref(l,LOC_REFERENCE,l.size,0);
             l.reference:=r;