From f2646fc92cb70c04c518478ed401e5393594d869 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 30 Jul 2010 01:07:31 -0400 Subject: [PATCH] cpu.x86: save context before calling new_context() since it can trigger GC (bug reported by Sascha Matzke) --- basis/cpu/x86/32/bootstrap.factor | 1 + basis/cpu/x86/64/bootstrap.factor | 1 + 2 files changed, 2 insertions(+) diff --git a/basis/cpu/x86/32/bootstrap.factor b/basis/cpu/x86/32/bootstrap.factor index fdcf5ca25f..e438bd1c0f 100644 --- a/basis/cpu/x86/32/bootstrap.factor +++ b/basis/cpu/x86/32/bootstrap.factor @@ -295,6 +295,7 @@ IN: bootstrap.x86 : jit-start-context ( -- ) ! Create the new context in return-reg jit-load-vm + jit-save-context ESP [] vm-reg MOV "new_context" jit-call diff --git a/basis/cpu/x86/64/bootstrap.factor b/basis/cpu/x86/64/bootstrap.factor index 308546131a..e8c8d99643 100644 --- a/basis/cpu/x86/64/bootstrap.factor +++ b/basis/cpu/x86/64/bootstrap.factor @@ -270,6 +270,7 @@ IN: bootstrap.x86 : jit-start-context ( -- ) ! Create the new context in return-reg + jit-save-context arg1 vm-reg MOV "new_context" jit-call