From d69a8c494bc42d6a8aa1d7f0d03dda7432b932a3 Mon Sep 17 00:00:00 2001 From: Vincent Geddes Date: Sat, 16 Aug 2008 23:30:25 +0200 Subject: [PATCH] FIX STORE_REGISTERS(). Must also store ip and sp in context objects, not just the st_cpu struct. --- src/st-cpu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/st-cpu.c b/src/st-cpu.c index 0ec5fc4..afe8824 100644 --- a/src/st-cpu.c +++ b/src/st-cpu.c @@ -395,12 +395,14 @@ lookup_method_in_cache (void) #define STACK_PUSH(oop) (*sp++ = (oop)) #define STACK_PEEK(oop) (*(sp-1)) #define STACK_UNPOP(count) (sp += count) -#define STORE_REGISTERS() \ - cpu->ip = ip - cpu->bytecode; \ - cpu->sp = sp - cpu->stack; -#define LOAD_REGISTERS() \ - ip = cpu->bytecode + cpu->ip; \ - sp = cpu->stack + cpu->sp; +#define STORE_REGISTERS() \ + cpu->ip = ip - cpu->bytecode; \ + cpu->sp = sp - cpu->stack; \ + ST_CONTEXT_PART_IP (cpu->context) = st_smi_new (cpu->ip); +#define LOAD_REGISTERS() \ + ip = cpu->bytecode + cpu->ip; \ + sp = cpu->stack + cpu->sp; \ + ST_CONTEXT_PART_SP (cpu->context) = st_smi_new (cpu->sp); void st_cpu_main (void) @@ -998,8 +1000,6 @@ st_cpu_main (void) send_common: - //printf ("%s\n", st_byte_array_bytes (cpu->message_selector)); - if (!lookup_method_in_cache ()) { STORE_REGISTERS (); cpu->new_method = lookup_method (cpu->lookup_class); -- 2.11.4.GIT