Browse Source

- reverted r16812 for now because it breaks building some packages

git-svn-id: trunk@16815 -
Jonas Maebe 14 years ago
parent
commit
ed1485c33e
2 changed files with 10 additions and 12 deletions
  1. 6 1
      compiler/ncginl.pas
  2. 4 11
      compiler/ninl.pas

+ 6 - 1
compiler/ncginl.pas

@@ -639,7 +639,12 @@ implementation
 
 
     procedure tcginlinenode.second_assigned;
     procedure tcginlinenode.second_assigned;
       begin
       begin
-        internalerror(2011012501);
+        secondpass(tcallparanode(left).left);
+        { force left to be an OS_ADDR, since in case of method procvars }
+        { the size is 2*OS_ADDR (JM)                                    }
+        cg.a_cmp_const_loc_label(current_asmdata.CurrAsmList,OS_ADDR,OC_NE,0,tcallparanode(left).left.location,current_procinfo.CurrTrueLabel);
+        cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
+        location_reset(location,LOC_JUMP,OS_NO);
       end;
       end;
 
 
     procedure Tcginlinenode.second_get_frame;
     procedure Tcginlinenode.second_get_frame;

+ 4 - 11
compiler/ninl.pas

@@ -2258,6 +2258,9 @@ implementation
                 begin
                 begin
                   { the parser has already made sure the expression is valid }
                   { the parser has already made sure the expression is valid }
 
 
+                  { there could be a procvar, which is 2*sizeof(pointer), while we }
+                  { must only check the first pointer -> can't just convert to an  }
+                  { add node in all cases                                          }
                   set_varstate(tcallparanode(left).left,vs_read,[vsf_must_be_valid]);
                   set_varstate(tcallparanode(left).left,vs_read,[vsf_must_be_valid]);
                   resultdef:=booltype;
                   resultdef:=booltype;
                 end;
                 end;
@@ -2719,17 +2722,7 @@ implementation
 
 
           in_assigned_x:
           in_assigned_x:
             begin
             begin
-              { in case of a complex procvar, only check the "code" pointer }
-              hp:=tcallparanode(left).left;
-              { reused }
-              tcallparanode(left).left:=nil;
-              if (hp.resultdef.typ=procvardef) and
-                 not tprocvardef(hp.resultdef).is_addressonly then
-                begin
-                  inserttypeconv_explicit(hp,search_system_type('TMETHOD').typedef);
-                  hp:=csubscriptnode.create(tsym(tabstractrecorddef(hp.resultdef).symtable.find('CODE')),hp);
-                end;
-              result:=caddnode.create(unequaln,hp,cnilnode.create);
+              expectloc := LOC_JUMP;
             end;
             end;
 
 
           in_pred_x,
           in_pred_x,