summaryrefslogtreecommitdiff
path: root/compiler/cgobj.pas
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-01-21 23:28:34 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-01-21 23:28:34 +0000
commit1903b037de2fb3e75826406b46f055acb70963fa (patch)
tree604cd8b790fe14e5fbe441d4cd647c80d2a36a9a /compiler/cgobj.pas
parentad1141d52f8353457053b925cd674fe1d5c4eafc (diff)
parent953d907e4d6c3a5c2f8aaee6e5e4f73c55ce5985 (diff)
downloadfpc-blocks.tar.gz
* synchronised with trunk till r29513blocks
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/blocks@29516 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/cgobj.pas')
-rw-r--r--compiler/cgobj.pas12
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/cgobj.pas b/compiler/cgobj.pas
index 473f673c8a..49a164effb 100644
--- a/compiler/cgobj.pas
+++ b/compiler/cgobj.pas
@@ -815,8 +815,15 @@ implementation
procedure tcg.translate_register(var reg : tregister);
+ var
+ rt: tregistertype;
begin
- rg[getregtype(reg)].translate_register(reg);
+ { Getting here without assigned rg is possible for an "assembler nostackframe"
+ function returning x87 float, compiler tries to translate NR_ST which is used for
+ result. }
+ rt:=getregtype(reg);
+ if assigned(rg[rt]) then
+ rg[rt].translate_register(reg);
end;
@@ -828,7 +835,8 @@ implementation
procedure tcg.a_reg_dealloc(list : TAsmList;r : tregister);
begin
- list.concat(tai_regalloc.dealloc(r,nil));
+ if (r<>NR_NO) then
+ list.concat(tai_regalloc.dealloc(r,nil));
end;