Browse Source

* give an internalerror if a setelementn is range in pass_generate_code,
as those constructs should have been converted to calls to
fpc_varset_set_range by the parent addn

git-svn-id: trunk@32293 -

Jonas Maebe 9 years ago
parent
commit
175f4376bc
1 changed files with 9 additions and 13 deletions
  1. 9 13
      compiler/ncgset.pas

+ 9 - 13
compiler/ncgset.pas

@@ -101,22 +101,18 @@ implementation
 
     procedure tcgsetelementnode.pass_generate_code;
       begin
-      { load first value in 32bit register }
-        secondpass(left);
-        if left.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
-          hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,u32inttype,false);
+        { load first value in 32bit register }
+          secondpass(left);
+          if left.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
+            hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,u32inttype,false);
 
-      { also a second value ? }
+        { also a second value ? }
         if assigned(right) then
-          begin
-            secondpass(right);
-            if codegenerror then
-              exit;
-            if right.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
-             hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,u32inttype,false);
-          end;
+          internalerror(2015111106);
 
-        { we doesn't modify the left side, we check only the type }
+        { we don't modify the left side, we only check the location type; our
+          parent node (an add-node) will use the resulting location to perform
+          the set operation without creating an intermediate set }
         location_copy(location,left.location);
       end;