From d98b625f1da3916be5f63cf46cf354813814e514 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 11 May 2004 06:16:32 +0000 Subject: [PATCH] _jit_regs_load_to_top_two: handle the case where the second value is on the stack but not the first. --- ChangeLog | 3 +++ jit/jit-reg-alloc.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 00e3c0d..4a8db29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,9 @@ fix a bug that caused global variables in Dynamic Pascal to be incorrectly allocated as locals. + * jit/jit-reg-alloc.c (_jit_regs_load_to_top_two): handle the + case where the second value is on the stack but not the first. + 2004-05-10 Rhys Weatherley * jit/jit-reg-alloc.c, jit/jit-reg-alloc.h, jit/jit-rules-interp.c: diff --git a/jit/jit-reg-alloc.c b/jit/jit-reg-alloc.c index d77c00c..4a5e173 100644 --- a/jit/jit-reg-alloc.c +++ b/jit/jit-reg-alloc.c @@ -1142,6 +1142,11 @@ int _jit_regs_load_to_top_two } spill_all_stack(gen, type_reg); } + else if(value2->in_register && !(value->in_register)) + { + /* We'll probably need to rearrange the stack, so spill first */ + spill_all_stack(gen, type_reg); + } /* If there are free registers of this type, then load the values now */ if(stack_regs_free(gen, type_reg, 2)) -- 2.47.3