Browse Source

Aslo check that live_end is assigned before refering to it

Pierre Muller 2 years ago
parent
commit
b49c3fe4f8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      compiler/rgobj.pas

+ 1 - 1
compiler/rgobj.pas

@@ -1943,7 +1943,7 @@ unit rgobj;
                   palloc:=tai_regalloc.alloc(r,live_start)
                   palloc:=tai_regalloc.alloc(r,live_start)
                 else
                 else
                   palloc:=tai_regalloc.alloc(r,nil);
                   palloc:=tai_regalloc.alloc(r,nil);
-                if live_end.typ=ait_instruction then
+                if assigned(live_end) and (live_end.typ=ait_instruction) then
                   pdealloc:=tai_regalloc.dealloc(r,live_end)
                   pdealloc:=tai_regalloc.dealloc(r,live_end)
                 else
                 else
                   pdealloc:=tai_regalloc.dealloc(r,nil);
                   pdealloc:=tai_regalloc.dealloc(r,nil);