From b762238f6317142e92df73cb068132337f3c9901 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 16 Oct 2009 21:07:09 -0500 Subject: [PATCH] cpu.x86.32: fix magic stack frame handling --- basis/cpu/x86/32/32.factor | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index ce73b4961e..d016712149 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -265,20 +265,19 @@ M: x86.32 %unnest-stacks ( -- ) ] with-aligned-stack ; M: x86.32 %prepare-alien-indirect ( -- ) - push-vm-ptr "unbox_alien" f %alien-invoke - temp-reg POP + 4 [ + push-vm-ptr + "unbox_alien" f %alien-invoke + ] with-aligned-stack EBP EAX MOV ; M: x86.32 %alien-indirect ( -- ) EBP CALL ; M: x86.32 %alien-callback ( quot -- ) - 4 [ - EAX swap %load-reference - EAX PUSH - param-reg-2 %mov-vm-ptr - "c_to_factor" f %alien-invoke - ] with-aligned-stack ; + param-reg-1 swap %load-reference + param-reg-2 %mov-vm-ptr + "c_to_factor" f %alien-invoke ; M: x86.32 %callback-value ( ctype -- ) ! Align C stack