2
0
Эх сурвалжийг харах

for explicit paralocs, don't use the original explicit register as temp, but allocate a new register the same type instead. this fixes issues when the paralocs are also scratch regs and would get overwritten before the call itself

git-svn-id: trunk@35192 -
Károly Balogh 8 жил өмнө
parent
commit
49cec23ba6

+ 4 - 1
compiler/paramgr.pas

@@ -425,7 +425,10 @@ implementation
               LOC_REGISTER :
               LOC_REGISTER :
                 begin
                 begin
                   if (vo_has_explicit_paraloc in parasym.varoptions) and (paraloc^.loc = LOC_REGISTER) then
                   if (vo_has_explicit_paraloc in parasym.varoptions) and (paraloc^.loc = LOC_REGISTER) then
-                    newparaloc^.register:=paraloc^.register
+                    if getregtype(paraloc^.register) = R_ADDRESSREGISTER then
+                      newparaloc^.register:=cg.getaddressregister(list)
+                    else
+                      newparaloc^.register:=cg.getintregister(list,paraloc^.size)
                   else
                   else
                     begin
                     begin
                       {$ifdef cpu_uses_separate_address_registers}
                       {$ifdef cpu_uses_separate_address_registers}