From b49c3fe4f8e3396aec1469fa072cd105a5db2965 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Mon, 13 Feb 2023 15:50:04 +0100 Subject: [PATCH] Aslo check that live_end is assigned before refering to it --- compiler/rgobj.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rgobj.pas b/compiler/rgobj.pas index 8fe941a4d3..0955abd423 100644 --- a/compiler/rgobj.pas +++ b/compiler/rgobj.pas @@ -1943,7 +1943,7 @@ unit rgobj; palloc:=tai_regalloc.alloc(r,live_start) else 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) else pdealloc:=tai_regalloc.dealloc(r,nil);