Browse Source

* nil method pointers can be kept in registers

git-svn-id: trunk@22340 -
florian 13 years ago
parent
commit
4d4561923e
1 changed files with 5 additions and 6 deletions
  1. 5 6
      compiler/ncgcnv.pas

+ 5 - 6
compiler/ncgcnv.pas

@@ -526,12 +526,11 @@ interface
       exit;
 {$endif}
 {$endif}
-      tg.gethltemp(current_asmdata.currasmlist,methodpointertype,methodpointertype.size,tt_normal,r);
-      location_reset_ref(location,LOC_REFERENCE,def_cgsize(resultdef),0);
-      location.reference:=r;
-      cg.a_load_const_ref(current_asmdata.currasmlist,OS_ADDR,0,r);
-      inc(r.offset,sizeof(puint));
-      cg.a_load_const_ref(current_asmdata.currasmlist,OS_ADDR,0,r);
+      location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
+      location.registerhi:=cg.getaddressregister(current_asmdata.currasmlist);
+      cg.a_load_const_reg(current_asmdata.currasmlist,OS_ADDR,0,location.registerhi);
+      location.register:=cg.getaddressregister(current_asmdata.currasmlist);
+      cg.a_load_const_reg(current_asmdata.currasmlist,OS_ADDR,0,location.register);
     end;
 
     procedure tcgtypeconvnode.second_bool_to_int;