From 9bbde3f60a9621c2ff3165534980f14b1be92920 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 8 Dec 2007 23:26:35 -0500 Subject: [PATCH] Fix Linux/x86-64 signal handler problem --- core/compiler/test/curry.factor | 2 +- core/compiler/test/simple.factor | 5 +++++ vm/os-linux-x86-64.h | 8 ++++++++ vm/platform.h | 1 - 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/compiler/test/curry.factor b/core/compiler/test/curry.factor index 307c8adcdb..0e840154ca 100755 --- a/core/compiler/test/curry.factor +++ b/core/compiler/test/curry.factor @@ -50,7 +50,7 @@ IN: temporary global keys = ] unit-test -[ 3 ] [ 1 2 [ curry [ 3 ] [ 4 ] if ] compile-1 ] unit-test +[ 3 ] [ 1 [ 2 ] [ curry [ 3 ] [ 4 ] if ] compile-1 ] unit-test [ 3 ] [ t [ 3 [ ] curry 4 [ ] curry if ] compile-1 ] unit-test diff --git a/core/compiler/test/simple.factor b/core/compiler/test/simple.factor index 594bb844a1..cc446dee23 100644 --- a/core/compiler/test/simple.factor +++ b/core/compiler/test/simple.factor @@ -56,3 +56,8 @@ IN: temporary \ recursive compile [ ] [ t recursive ] unit-test + +! Make sure error reporting works + +[ [ dup ] compile-1 ] unit-test-fails +[ [ drop ] compile-1 ] unit-test-fails diff --git a/vm/os-linux-x86-64.h b/vm/os-linux-x86-64.h index 2bbae86f6e..911c2f1749 100644 --- a/vm/os-linux-x86-64.h +++ b/vm/os-linux-x86-64.h @@ -1,2 +1,10 @@ +#include + +INLINE void *ucontext_stack_pointer(void *uap) +{ + ucontext_t *ucontext = (ucontext_t *)uap; + return (void *)ucontext->uc_mcontext.gregs[15]; +} + #define UAP_PROGRAM_COUNTER(ucontext) \ (((ucontext_t *)(ucontext))->uc_mcontext.gregs[16]) diff --git a/vm/platform.h b/vm/platform.h index f181c93e2c..75228726a9 100644 --- a/vm/platform.h +++ b/vm/platform.h @@ -70,7 +70,6 @@ #elif defined(FACTOR_ARM) #include "os-linux-arm.h" #elif defined(FACTOR_AMD64) - #include "os-unix-ucontext.h" #include "os-linux-x86-64.h" #else #error "Unsupported Linux flavor"