浏览代码

* fixed web bug #4872

git-svn-id: trunk@2738 -
Jonas Maebe 19 年之前
父节点
当前提交
b063d47aa1
共有 1 个文件被更改,包括 11 次插入10 次删除
  1. 11 10
      compiler/ncgmem.pas

+ 11 - 10
compiler/ncgmem.pas

@@ -682,16 +682,7 @@ implementation
                  objectlibrary.getjumplabel(falselabel);
                  objectlibrary.getjumplabel(falselabel);
                end;
                end;
               secondpass(right);
               secondpass(right);
-
-              if cs_check_range in aktlocalswitches then
-               begin
-                 if left.resulttype.def.deftype=arraydef then
-                   rangecheck_array;
-               end;
-
-              { if mulsize = 1, we won't have to modify the index }
-              location_force_reg(exprasmlist,right.location,OS_ADDR,(mulsize = 1));
-
+              
               if isjump then
               if isjump then
                begin
                begin
                  truelabel:=otl;
                  truelabel:=otl;
@@ -700,6 +691,16 @@ implementation
               else if (right.location.loc = LOC_JUMP) then
               else if (right.location.loc = LOC_JUMP) then
                 internalerror(2006010801);
                 internalerror(2006010801);
 
 
+              { if mulsize = 1, we won't have to modify the index }
+              location_force_reg(exprasmlist,right.location,OS_ADDR,(mulsize = 1));
+
+              { only range check now, we can't range check loc_flags/loc_jump }
+              if cs_check_range in aktlocalswitches then
+               begin
+                 if left.resulttype.def.deftype=arraydef then
+                   rangecheck_array;
+               end;
+
             { produce possible range check code: }
             { produce possible range check code: }
               if cs_check_range in aktlocalswitches then
               if cs_check_range in aktlocalswitches then
                begin
                begin